help with openargs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I try to search a record then passing case number to another form using
openargs but some how it is not passing ? Here piece of my code:

On the SEARCH FORM onclick event I code:
DoCmd.OpenForm "FrmEdit", , , , , , Me.CaseNoBox

On the "FrmEdit" Open Event I code:
If Not IsNull(Me.OpenArgs) Then
Dim Casenum As String
Casenum = Me.OpenArgs
Dim RS As Recordset
Set RS = Me.RecordsetClone
RS.FindFirst "Caseno = '" & Casenum & "'"
If Not RS.NoMatch Then
Me.Bookmark = RS.Bookmark
End If
End If
But the value is NULL, Please help!
MN
 
Try feeding the Me.CaseNoBox into a variable before opening the other form.

CaseNo = Me.CaseNoBox
Docmd.OpenForm "FrmEdit",,,,,,CaseNo

Hope that helps.
 
Thank for reply,
But it is still nothing return ?
I still working on it to see what happen !
Again Thanks
MN
 
Never mind...it is working now...Thanks

Conrad said:
Try feeding the Me.CaseNoBox into a variable before opening the other form.

CaseNo = Me.CaseNoBox
Docmd.OpenForm "FrmEdit",,,,,,CaseNo

Hope that helps.
 
MN said:
I try to search a record then passing case number to another form using
openargs but some how it is not passing ? Here piece of my code:

On the SEARCH FORM onclick event I code:
DoCmd.OpenForm "FrmEdit", , , , , , Me.CaseNoBox

On the "FrmEdit" Open Event I code:
If Not IsNull(Me.OpenArgs) Then
Dim Casenum As String
Casenum = Me.OpenArgs
Dim RS As Recordset
Set RS = Me.RecordsetClone
RS.FindFirst "Caseno = '" & Casenum & "'"
If Not RS.NoMatch Then
Me.Bookmark = RS.Bookmark
End If
End If
But the value is NULL


If the OpenArgs value is Null, then that's what was passed
from the search form. Go back to the search form and check
that the value of the CaseNoBox text box is valid.

If the problem is just that it didn't navigate to the
specified record, then put the code in the Load event. The
Open event is too early for record manipulation.
 
Back
Top