Openargs Not Working

J

JamesJ

I'm using the following to open frmRemindersEdit to the record with
the same ReminderID. The form, frmRemindersSub is a sub form of
another form and when I click on the ID field it doesn't bring up that
record with the same ID. It opens to the first record. It works fine
when doing it directly from frmRemindersSub but not when it is the subform.
Seems like it was working before.
--------------
Private Sub ReminderID_Click()

If Not IsNull(Me.ReminderID) Then

DoCmd.OpenForm "frmRemindersEdit", OpenArgs:=Me.ReminderID
Else
DoCmd.OpenForm "frmRemindersEdit", , , , acFormAdd
End If

End Sub
------------------
This is what I have in the OnLoad of frmRemindersEdit:
---------------------
Private Sub Form_Load()

If Not IsNull(Me.OpenArgs) Then

With Me.RecordsetClone
.FindFirst "ReminderID=" & Me.OpenArgs
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

End If

Me.Reminder.SetFocusEnd Sub
 
L

Linq Adams via AccessMonster.com

If ReminderID is defined as Number Datatype,

FindFirst "ReminderID=" & Me.OpenArgs

is correct.

But if ReminderID is defined as a Text Datatype, the syntax should be

FindFirst "ReminderID= '" & Me.OpenArgs & "'"
 
J

JamesJ

I imported the main form from a backup and it works ok now.
I don't recall making any changes to this, but at my age you never know.

James
 
J

JamesJ

I think something was wrong with the parent form.
I imported a form form a backup and it workd ok.

Thanks,
James
 
L

Linq Adams via AccessMonster.com

To quote a past leader of this country "I feel your pain!" ;0)>
 

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

Top