help with openargs

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
 
G

Guest

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

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

Hope that helps.
 
G

Guest

Thank for reply,
But it is still nothing return ?
I still working on it to see what happen !
Again Thanks
MN
 
G

Guest

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.
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top