jd_boss_hogg
Registered User.
- Local time
- Today, 15:46
- Joined
- Aug 5, 2009
- Messages
- 88
Hi All - hoping someone can help me with the structure of some coding. I do dbase programming every 6 months, for a few minutes a time, and have never really learned how to structure things correctly.
I have a button on a form which runs a macro. That macro does various tasks. I have some code on an event procedure (lost focus) on another form, and i'd like to use that code in the macro from the click of the button . I thought i could just use "run code" and paste the stuff into a module/function. However, looks like functions work completly differently to event procedures, and that is what i don;t understand.
This is what i want to do, preferably from a line in the macro.
Sorry if ive used the wrong terminology or stuff...
I have a button on a form which runs a macro. That macro does various tasks. I have some code on an event procedure (lost focus) on another form, and i'd like to use that code in the macro from the click of the button . I thought i could just use "run code" and paste the stuff into a module/function. However, looks like functions work completly differently to event procedures, and that is what i don;t understand.
This is what i want to do, preferably from a line in the macro.
At the moment, the only way i can get it to do the above is to have both an OnClick (macro) AND lost focus (event) on the same button, but that's just messy.Private Sub print_advice_LostFocus()
Dim strMsg
Dim Strusername
Strusername = Environ("username")
strMsg = Strusername & " , INVOICED" & Chr(13) & Chr(10)
Set db = CurrentDb
[job_history] = strMsg & [job_history]
End Sub
Sorry if ive used the wrong terminology or stuff...