G
Guest
I have the following codes attached to 2 forms
1. Attached to a combo box on a pop-up bo
Private Sub name_NotInList(NewData As String, Response As Integer
Dim Resul
Dim Msg As Strin
Dim CR As Strin
CR = Chr$(13
If NewData = "" Then Exit Su
Msg = "'" & NewData & "' is not in the list." & CR & C
Msg = Msg & "PS Number not listed. Do you wish to add?
If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes The
DoCmd.OpenForm "Overall Information", , , , acAdd, acDialog, NewDat
End I
Result = DLookup("[PS Number]", "PS Numbers",
"[PS Number]='" & NewData & "'"
If IsNull(Result) The
Response = acDataErrContinu
MsgBox "Negative Response!
Els
Response = acDataErrAdde
End I
End Su
2. Attached to the OnLoad property of the main underlying form
Private Sub Form_Load(
If Not IsNull(Me.OpenArgs) The
Me![PS Number] = Me.OpenArg
End I
End Su
Is there any way I can close the initial pop-form without having to resort to using a macro
Similarly, I have another pop-up form which performs the same function as the first pop-up form but refers to a customer supplied ID number (the first pop-up box contains our unique reference numbers). How do I alter the on load section code to transfer this "not in list" data to another field on the main underlying form (specified in 2. above)
Thanking you in antici...patio
Perry Kerr
1. Attached to a combo box on a pop-up bo
Private Sub name_NotInList(NewData As String, Response As Integer
Dim Resul
Dim Msg As Strin
Dim CR As Strin
CR = Chr$(13
If NewData = "" Then Exit Su
Msg = "'" & NewData & "' is not in the list." & CR & C
Msg = Msg & "PS Number not listed. Do you wish to add?
If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes The
DoCmd.OpenForm "Overall Information", , , , acAdd, acDialog, NewDat
End I
Result = DLookup("[PS Number]", "PS Numbers",
"[PS Number]='" & NewData & "'"
If IsNull(Result) The
Response = acDataErrContinu
MsgBox "Negative Response!
Els
Response = acDataErrAdde
End I
End Su
2. Attached to the OnLoad property of the main underlying form
Private Sub Form_Load(
If Not IsNull(Me.OpenArgs) The
Me![PS Number] = Me.OpenArg
End I
End Su
Is there any way I can close the initial pop-form without having to resort to using a macro
Similarly, I have another pop-up form which performs the same function as the first pop-up form but refers to a customer supplied ID number (the first pop-up box contains our unique reference numbers). How do I alter the on load section code to transfer this "not in list" data to another field on the main underlying form (specified in 2. above)
Thanking you in antici...patio
Perry Kerr