accessNOOB1234
New member
- Local time
- Today, 15:11
- Joined
- Jun 26, 2011
- Messages
- 3
I have VB Code running (which I pulled from another site), and I was wondering if there was anyway to make it say that ONLY these entries are valid.
I was wanting to only allow the status to be set to Active or Inactive. Is there a way to do this?
Code:
DoCmd.SetWarnings False
If IsNull(DLookup("ProgramName", "tbl123", "ProgramName ='" & Me.ProgramName & "'")) Then
DoCmd.RunSQL "INSERT INTO tbl123(ProgramName, Status) VALUES('" & Me.ProgramName & "', '" & Me.Status & "')"
Else
DoCmd.RunSQL "UPDATE tbl123 SET Status ='" & Me.Status & "' WHERE ProgramName='" & Me.ProgramName & "'"
End If
DoCmd.SetWarnings True