J
Jen
I have a command button that fills in address, etc. information based on the
value selected in a field. (This might seem strange, but there are good
reasons for doing it this way in this case.) So the user selects a party from
the combo box, then can either enter address info or can click the command
button to fill in the most-recently-used data for that party.
This works fine. However, if a party hasn't been selected from the list, I
want to cancel the fill in of data. Currently if you click the command button
while nothing is selected, it still gives the msgbox message that's set to
come up after the update.
I've tried inserting this at the front of the code, but it's not working.
What am I doing wrong?
If IsNull(Forms!Agreements!Party) =True Then
Response = MsgBox("You must choose a party first.", vbOKOnly +
vbExclamation, "Select Party")
Exit Sub
End If
If Forms!Agreements!Party = "" Then
Response = MsgBox("You must choose a party first.", vbOKOnly +
vbExclamation, "Select Party")
Exit Sub
End If
(I've also tried different variations, such as replacing
Forms!Agreements!Party with Me!Party. Still nothing happens - it's as if the
code at the beginning is skipped over.)
Thanks,
Jen
value selected in a field. (This might seem strange, but there are good
reasons for doing it this way in this case.) So the user selects a party from
the combo box, then can either enter address info or can click the command
button to fill in the most-recently-used data for that party.
This works fine. However, if a party hasn't been selected from the list, I
want to cancel the fill in of data. Currently if you click the command button
while nothing is selected, it still gives the msgbox message that's set to
come up after the update.
I've tried inserting this at the front of the code, but it's not working.
What am I doing wrong?
If IsNull(Forms!Agreements!Party) =True Then
Response = MsgBox("You must choose a party first.", vbOKOnly +
vbExclamation, "Select Party")
Exit Sub
End If
If Forms!Agreements!Party = "" Then
Response = MsgBox("You must choose a party first.", vbOKOnly +
vbExclamation, "Select Party")
Exit Sub
End If
(I've also tried different variations, such as replacing
Forms!Agreements!Party with Me!Party. Still nothing happens - it's as if the
code at the beginning is skipped over.)
Thanks,
Jen