Click Event for Subform

J

JamesJ

I'm attempting to move the focus to another control on my form when the
user clicks on a subform but it doesn't seem to work:

Private Sub frmRemindersSub_Click()

Me.cmdDbProperties.SetFocus

End Sub

The subform has 4 fields on it. All are disabled and locked except for the
ID field
which is enbabled and locked, which when clicked, opens a form to the
corresponding record.
When one clicks elsewhere in the subform the ID is highlight (selected) and
for cosmetic reasons I
don't want this to happen.
Any ideas?

Thanks,
James
 
J

JamesJ

I spoke too soon
Of course you can't correct one thing in access without creating another
problem.
The subform has 4 fields on it. All are disabled and locked except for the
ID field which is enabled and locked, which when clicked, opens a form to
the
corresponding record.
Now the editing form isn't opening on the corresponfoding record. It opens
on the first
record. When I remark out the line out in the Enter event of the subform it
works ok.

Private Sub frmRemindersSub_Enter() it opens to the correct record.

Me.cmdDbProperties.SetFocus

End Sub

This is the code for the Load event of the editing form.

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

End Sub

When I use the Enter event for the subform the editing form
(frmRemindersEdit) opens to the first record
no matter which record I click on in the subform.
I don't know why going to a control on the first form id causing this code
not to work.

Any suggestions on this?
James
 
J

JamesJ

To get around it instead of having the ID field and more-or-less replaced it
with
small command buttons to open the editing form to the selected record.
No need to have a field that is enabled on the subform and having the field
data
getting selected if one clicks in the subform.
Oh yes. No I don't talk to myself all the time.

James
 

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