M
miss031
I have a form with an unbound subform that is bound to a particular form
depending on which selection in the control group on the main form is chosen.
When the subform is bound to one form, and it loads, I have a form that pops
up as a message box, but I would like this message box to only pop up if a
subform on *that subform* has a record. Confused yet?
Main form: ""add_new_all"
control group on main form: "frame_choose_sub"
option chosen: "btn_contact_info"
subform control on main form: "subf_main_blank"
When the option is chosen, the 'blank subform' control loads with the form
"subf_main_contact_info".
On this form is a subform control: "tbl_short_memos subform"
which has a combo: "cbo_short_memo_message"
The contents of the combo will be displayed in the pop-up message box when
the contact info form is loaded. If the combo is blank, I would like to *not*
display the pop-up.
I can only get it to pop up *every* time the form is loaded, and when the
combo is blank, it just shows a blank message box.
I tried the code in Form_Load and Form_Open, and now I havethe following in
the AfterUpdate of the control group (frame_choose_sub):
Dim StrMsg As String
Dim strWhere As String 'added
strWhere = "contact_ID = " & Me.contact_ID
If Frame191 = 1 Then
Me.subf_main_blank.Visible = True
Me.subf_main_blank.SourceObject = "subf_main_contact_info"
Me.subf_main_blank.LinkMasterFields = "contact_ID"
Me.subf_main_blank.LinkChildFields = "contact_ID"
Me.subf_main_blank.Form![Dummy] = 1
If Not IsNull(Me.subf_main_blank.Form![tbl_cont_short_memos
subform]!cbo_short_memo_message) Then
DoCmd.OpenForm "short_memo_box", acNormal, , strWhere
Else: DoCmd.CancelEvent
End If
Please help! Thanks.
depending on which selection in the control group on the main form is chosen.
When the subform is bound to one form, and it loads, I have a form that pops
up as a message box, but I would like this message box to only pop up if a
subform on *that subform* has a record. Confused yet?
Main form: ""add_new_all"
control group on main form: "frame_choose_sub"
option chosen: "btn_contact_info"
subform control on main form: "subf_main_blank"
When the option is chosen, the 'blank subform' control loads with the form
"subf_main_contact_info".
On this form is a subform control: "tbl_short_memos subform"
which has a combo: "cbo_short_memo_message"
The contents of the combo will be displayed in the pop-up message box when
the contact info form is loaded. If the combo is blank, I would like to *not*
display the pop-up.
I can only get it to pop up *every* time the form is loaded, and when the
combo is blank, it just shows a blank message box.
I tried the code in Form_Load and Form_Open, and now I havethe following in
the AfterUpdate of the control group (frame_choose_sub):
Dim StrMsg As String
Dim strWhere As String 'added
strWhere = "contact_ID = " & Me.contact_ID
If Frame191 = 1 Then
Me.subf_main_blank.Visible = True
Me.subf_main_blank.SourceObject = "subf_main_contact_info"
Me.subf_main_blank.LinkMasterFields = "contact_ID"
Me.subf_main_blank.LinkChildFields = "contact_ID"
Me.subf_main_blank.Form![Dummy] = 1
If Not IsNull(Me.subf_main_blank.Form![tbl_cont_short_memos
subform]!cbo_short_memo_message) Then
DoCmd.OpenForm "short_memo_box", acNormal, , strWhere
Else: DoCmd.CancelEvent
End If
Please help! Thanks.