S
sandi
I have one form, frmClInfo that can be called from a dblclick and a
notinlist event.
On double click, I would like the form to open to record based on the
CaseNumber primary key.
On the notinlist I would like the add a new record with the LastName
field filled with the value from the notinlist event. (There are other
fields to be filled in on the form too)
What I have for dblclick and notinlist is:
Private Sub cboLastName_DblClick(Cancel As Integer)
If IsNull(Me!cboLastName) Then
Else
DoCmd.OpenForm "frmClInfo", , , , , , CaseNumber
End If
End Sub
_____________________
Private Sub cboLastName_NotInList(NewData As String, Response As
Integer)
Dim strsql As String, X As Integer
X = MsgBox("Do you want to add this value to the list?",
vbYesNo)
If X = vbYes Then
DoCmd.OpenForm "frmClInfo", , , , acFormAdd, acDialog,
LastName
Response = acDataErrAdded
Else
Me.cboLastName.Undo
Response = acDataErrContinue
End If
End Sub
___________________
Then OnLoad I have this:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Select Case Me.OpenArgs
Case "CaseNumber"
With Me.RecordsetClone
.FindFirst "CaseNumber='" & Me.OpenArgs & "'"
'encased in quotes because it's a string
'pass CaseID from subform to client info form
If Not .NoMatch Then Me.Bookmark = .Bookmark
End With
Case "LastName"
Me.LastName = Me.OpenArgs
CaseNumber.SetFocus
End Select
End If
End Sub
OpenArgs gets the information from the previous cbobox, but then it
passes over both case statments and goes to the end.
The clientinfo form opens but not with the correct client (if double
click event called it)
and in the second case, the client info form opens but no text in the
last name field.
The code works well if I comment out all the Select case, case... end
case statements.
What am I doing wrong?
ARRRGH!
Thanks for any help!!!
Sandi
notinlist event.
On double click, I would like the form to open to record based on the
CaseNumber primary key.
On the notinlist I would like the add a new record with the LastName
field filled with the value from the notinlist event. (There are other
fields to be filled in on the form too)
What I have for dblclick and notinlist is:
Private Sub cboLastName_DblClick(Cancel As Integer)
If IsNull(Me!cboLastName) Then
Else
DoCmd.OpenForm "frmClInfo", , , , , , CaseNumber
End If
End Sub
_____________________
Private Sub cboLastName_NotInList(NewData As String, Response As
Integer)
Dim strsql As String, X As Integer
X = MsgBox("Do you want to add this value to the list?",
vbYesNo)
If X = vbYes Then
DoCmd.OpenForm "frmClInfo", , , , acFormAdd, acDialog,
LastName
Response = acDataErrAdded
Else
Me.cboLastName.Undo
Response = acDataErrContinue
End If
End Sub
___________________
Then OnLoad I have this:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Select Case Me.OpenArgs
Case "CaseNumber"
With Me.RecordsetClone
.FindFirst "CaseNumber='" & Me.OpenArgs & "'"
'encased in quotes because it's a string
'pass CaseID from subform to client info form
If Not .NoMatch Then Me.Bookmark = .Bookmark
End With
Case "LastName"
Me.LastName = Me.OpenArgs
CaseNumber.SetFocus
End Select
End If
End Sub
OpenArgs gets the information from the previous cbobox, but then it
passes over both case statments and goes to the end.
The clientinfo form opens but not with the correct client (if double
click event called it)
and in the second case, the client info form opens but no text in the
last name field.
The code works well if I comment out all the Select case, case... end
case statements.
What am I doing wrong?
ARRRGH!
Thanks for any help!!!
Sandi