EzGoingKev
Registered User.
- Local time
- Yesterday, 21:04
- Joined
- Nov 8, 2019
- Messages
- 185
Good afternoon.
I have this if statement in VBA -
If (Not IsNull(DLookup("[Part Manufacturer]", "[export_sheet]"))) Then
If (MsgBox("Delete PN's w/o manufacturer names?", 4) = 6) Then
DoCmd.RunSQL "DELETE FROM export_sheet WHERE [Part Manufacturer] IS NULL", -1
End If
End If
Part Manufacturer is a field in the export_sheet table. If there are null values in that field I want the message box to open and ask me if I want to delete. If there are not any null values in that field then it should stop.
It is asking me if I want to delete all the time. It does not matter if there are/are not null values in the Part Manufacturer field. I have played around with it some and cannot get it to work like I want it to. Where did I go wrong?
I have this if statement in VBA -
If (Not IsNull(DLookup("[Part Manufacturer]", "[export_sheet]"))) Then
If (MsgBox("Delete PN's w/o manufacturer names?", 4) = 6) Then
DoCmd.RunSQL "DELETE FROM export_sheet WHERE [Part Manufacturer] IS NULL", -1
End If
End If
Part Manufacturer is a field in the export_sheet table. If there are null values in that field I want the message box to open and ask me if I want to delete. If there are not any null values in that field then it should stop.
It is asking me if I want to delete all the time. It does not matter if there are/are not null values in the Part Manufacturer field. I have played around with it some and cannot get it to work like I want it to. Where did I go wrong?