ASKER
Private Sub cbo_Field1_BeforeUpdate(cancel as integer)
Dim strField1 as string
Dim strMsg as string
strField1 = me.[subformControlName].[Form]![Field1]
if me.cbo_Field1 <> strField1 then
strMsg = "You have selected a State value different than that displayed below!"
if msgbox(strMsg, vbcritical + vbOKCancel) = vbCancel then
Cancel = true
exit sub
else
'this may not be necessary if the subform is linked to the main form on Field1
me.[subformControlName].Form].requery
end if
end if
End Sub
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
[Forms]![MainFormName]![Su
So if I had frmCustomers, with another form called frmOrders, and I used the subform control on frmCustomers to display frmOrders, I would need to use the name I have given to the subform control, in order to refer to a control on that subform. Imagine I called the subform control frmsubOrders, then to refer to the txtOrderID control, I would use:
[Forms]![frmCustomers]![fr