Here is how I understand your requirements:
1) There is a listbox called PO on Form [ASN_Appointment], loaded with information from table AHASNF00 and bound to a column with the AHSHMT field values.
2) When the user selects a PO number that is in the dropdown list, the form must load the related information from the AHASNF00 record with that AHSHMT value.
3) When the user enters a PO number that is NOT in the dropdown list, the form must force the user to enter the required information for that new PO, which must then be added to that table.
If this is correct, then there are a few things I would suggest.
First, move your code to the AfterUpdate Event for the listbox, not the Click event.
Second, if the four variable names used in your code in PO_Click are the names of other controls on the same form, please standardize your code to use Me.controlname to refer to the controls.
Third, error trap your Dlookups by using the NZ(,) function around them, and take appropriate action.
Fourth, check for the existence of the PO before doing all your Dlookups.
Code:
Private Sub PO_AfterUpdate()
Dim POTest As String
' Read for existence of the requested PO
POTest = NZ(DLookup("AHSHMT", "AHASNF00", "AHSHMT=" & Forms![ASN_Appointment]!PO),"")
' If the PO exists, use the values
If POTest = Forms![ASN_Appointment]!PO Then
Me.AHVNAM = DLookup("AHVNAM", "AHASNF00", "AHSHMT=" & Forms![ASN_Appointment]!PO)
Me.AHSHDT = DLookup("AHSHDT", "AHASNF00", "AHSHMT=" & Forms![ASN_Appointment]!PO)
Me.AHSERD = DLookup("AHSERD", "AHASNF00", "AHSHMT=" & Forms![ASN_Appointment]!PO)
Me.Vendor_No = DLookup("AHRCFR", "AHASNF00", "AHSHMT=" & Forms![ASN_Appointment]!PO)
Else
' otherwise, pop up a modal data entry form to get all the new information
' using any of various ways to do this
End If
End Sub
I would tend to use a popup modal data entry form that collects and validates all the required fields for the new PO, then saves them to the AHASNF00 table, requeries the listbox and loads the main form with the newly entered values.