G
Guest
If a particular field on a particular form is blank, I need to do one thing.
If that field has something in it, I need to do one thing and then I need to
do one more thing. I messed up.
The offending portion of the code below apparently has to do with
referencing the blank field. When I run this, it breaks at the first If,
telling me to provide a valid object qualifier. Well, lo and behold, if I
scroll my cursor over the bad code, it tells me that it recognizes the field
is indeed blank, so I must have qualified the object with validitiliness.
(The only addition to the existing code is the If Then statement. The SQL
works, the DoCmd works, even
"Forms!frmTransmittals!frmTransmittalsData.Form.Requery" works, although I
think that's an awkward was to word the request, this is how Access
apparently wants it.)
Private Sub cmdUpdateTemp_Click()
Dim MySQL As String
MySQL = "DO THIS THING"
DoCmd.RunSQL MySQL
If [Forms]![frmTransmittals]![txtNewTRNum] Is Null Then
Forms!frmTransmittals!frmTransmittalsData.Form.Requery
ElseIf [Forms]![frmTransmittals]![txtNewTRNum] Is Not Null Then
MySQL = "NOW DO THIS DIFFERENT THING"
DoCmd.RunSQL MySQL
Forms!frmTransmittals!frmTransmittalsData.Form.Requery
End If
End Sub
If that field has something in it, I need to do one thing and then I need to
do one more thing. I messed up.
The offending portion of the code below apparently has to do with
referencing the blank field. When I run this, it breaks at the first If,
telling me to provide a valid object qualifier. Well, lo and behold, if I
scroll my cursor over the bad code, it tells me that it recognizes the field
is indeed blank, so I must have qualified the object with validitiliness.
(The only addition to the existing code is the If Then statement. The SQL
works, the DoCmd works, even
"Forms!frmTransmittals!frmTransmittalsData.Form.Requery" works, although I
think that's an awkward was to word the request, this is how Access
apparently wants it.)
Private Sub cmdUpdateTemp_Click()
Dim MySQL As String
MySQL = "DO THIS THING"
DoCmd.RunSQL MySQL
If [Forms]![frmTransmittals]![txtNewTRNum] Is Null Then
Forms!frmTransmittals!frmTransmittalsData.Form.Requery
ElseIf [Forms]![frmTransmittals]![txtNewTRNum] Is Not Null Then
MySQL = "NOW DO THIS DIFFERENT THING"
DoCmd.RunSQL MySQL
Forms!frmTransmittals!frmTransmittalsData.Form.Requery
End If
End Sub