Hi there,
I need some help setting up a few functions that can be called by any form to display each of the dialog forms in my database. I have included some examples of the current code below.
Currently I use the full code for each instance it is needed via event procedures (the code is used about 6-8 times on each subform, basically if you click on any area of the subform it brings up that specific record). This is frustrating as each time I change my coding I have to change it in numerous places. My basic understanding would be that I need to code a function for each dialog box called.
I’m also unsure as to how I would call this type of function in a subform so any help on this would be appreciated. Currently I have a few pubic functions I have set up in a module called mod_ProcedureLibrary. I then call these via a macro using ‘RunCode’ but I have no idea how to do this for the new functions.
Code for data entry dialog form:
Private Sub CustCode_Click()
If Not Me.NewRecord Then
DoCmd.OpenForm "frm_dialog_IndividualContact", _
, _
, _
"[CustCode]='" & Me.[CustCode] & _
"' And [DelSeqCode]='" & Me.[DelSeqCode] & _
"' And [ContactDate]=#" & Me.[ContactDate] & _
"# And [ContactTime]=#" & Me.[ContactTime] & "#", _
, _
acDialog
Else
DoCmd.OpenForm "frm_dialog_IndividualContact", _
, _
, _
, _
acFormAdd, _
acDialog
End If
End Sub
Code for display dialog form:
Private Sub AS400telesalesInfo_Click()
On Error GoTo Err_AS400telesalesInfo_Click
DoCmd.OpenForm "frm_dialog_AS400telesalesInfo", acNormal, , "[CustCode]='" & Me.[CustCode] & "' And [DelSeqCode]='" & Me.[DelSeqCode] & "'", , acDialog
Exit_AS400telesalesInfo_Click:
Exit Sub
Err_AS400telesalesInfo_Click:
MsgBox Err.Description
Resume Exit_AS400telesalesInfo_Click
End Sub
I am working in Access 2003. Let me know if you require anymore information. Thank you in advance for your help.
Thanks Jodie
I need some help setting up a few functions that can be called by any form to display each of the dialog forms in my database. I have included some examples of the current code below.
Currently I use the full code for each instance it is needed via event procedures (the code is used about 6-8 times on each subform, basically if you click on any area of the subform it brings up that specific record). This is frustrating as each time I change my coding I have to change it in numerous places. My basic understanding would be that I need to code a function for each dialog box called.
I’m also unsure as to how I would call this type of function in a subform so any help on this would be appreciated. Currently I have a few pubic functions I have set up in a module called mod_ProcedureLibrary. I then call these via a macro using ‘RunCode’ but I have no idea how to do this for the new functions.
Code for data entry dialog form:
Private Sub CustCode_Click()
If Not Me.NewRecord Then
DoCmd.OpenForm "frm_dialog_IndividualContact", _
, _
, _
"[CustCode]='" & Me.[CustCode] & _
"' And [DelSeqCode]='" & Me.[DelSeqCode] & _
"' And [ContactDate]=#" & Me.[ContactDate] & _
"# And [ContactTime]=#" & Me.[ContactTime] & "#", _
, _
acDialog
Else
DoCmd.OpenForm "frm_dialog_IndividualContact", _
, _
, _
, _
acFormAdd, _
acDialog
End If
End Sub
Code for display dialog form:
Private Sub AS400telesalesInfo_Click()
On Error GoTo Err_AS400telesalesInfo_Click
DoCmd.OpenForm "frm_dialog_AS400telesalesInfo", acNormal, , "[CustCode]='" & Me.[CustCode] & "' And [DelSeqCode]='" & Me.[DelSeqCode] & "'", , acDialog
Exit_AS400telesalesInfo_Click:
Exit Sub
Err_AS400telesalesInfo_Click:
MsgBox Err.Description
Resume Exit_AS400telesalesInfo_Click
End Sub
I am working in Access 2003. Let me know if you require anymore information. Thank you in advance for your help.
Thanks Jodie