Next challenge;
I used to do this with a macro, but now I want to do it in VB.
I had a macro that would open a modal form with an unbound listbox control, the user selects a value from the drop-down list, and then clicks an "OK" button. The button would fire another macro that would set the value so that a query def subsequently opened by the original macro would have the value passed into it. The "OK' button macro was quite simple:
I tried to let Access convert it to a module, but the resulting module has errors and will not compile.
I get a syntax error on the ".visible =" line. Does anyone know what I need to do to fix this?
Thanks in advance!
I used to do this with a macro, but now I want to do it in VB.
I had a macro that would open a modal form with an unbound listbox control, the user selects a value from the drop-down list, and then clicks an "OK" button. The button would fire another macro that would set the value so that a query def subsequently opened by the original macro would have the value passed into it. The "OK' button macro was quite simple:
SetValue ( Item [Visible] )
Close ( Object Type Form
Object Name MyFormName
Save Yes )
Close ( Object Type Form
Object Name MyFormName
Save Yes )
I tried to let Access convert it to a module, but the resulting module has errors and will not compile.
I get a syntax error on the ".visible =" line. Does anyone know what I need to do to fix this?
Function mac_sample()
On Error GoTo mac_sample_Err
With CodeContextObject
.Visible =
DoCmd.Close acForm, "frm_myFormName"
End With
mac_sample_Exit:
Exit Function
mac_sample_Err:
MsgBox Error$
Resume mac_sample_Exit
End Function
On Error GoTo mac_sample_Err
With CodeContextObject
.Visible =
DoCmd.Close acForm, "frm_myFormName"
End With
mac_sample_Exit:
Exit Function
mac_sample_Err:
MsgBox Error$
Resume mac_sample_Exit
End Function
Thanks in advance!