Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Empty fields

Status
Not open for further replies.

downtime

IS-IT--Management
May 16, 2002
98
0
0
US
What would a query look like to find a empty field within a record? I am looking to find a way to tell the user that there is no information for that record. EX: User is looking for a City, City doesn't exist within the database. How do I get a prompt or window to display telling the user that the information doesn't exist?
 
I have a Look up table for City's. On my form I attached this Event to Not in List. City is a combo box.

This event will tell user the city tey typed in is not in the list and give them the chance to add it using another entry form created. You can omit that part.

Private Sub City_NotInList(NewData As String, Response As Integer)
If MsgBox("Do you want to add '" _
& NewData & "' to the items in this control?", _
vbOKCancel, "Add New Item?") = vbOK Then

' Remove new data from combo box so control can be requeried
' after the AddCity form is closed.
DoCmd.RunCommand acCmdUndo

' Display form to collect data needed for the new record.
DoCmd.OpenForm "frm_AddCity", acNormal, , , acAdd, acDialog, NewData

' Continue without displaying default error message.
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top