SubForm/ListBox Problem

EssexRob

Registered User.
Local time
Today, 21:16
Joined
Jan 30, 2006
Messages
22
hey everyone.

I have a form, and this form contains a list box which displays data from a query. When you double click on the list result it displays the results on the form. (This is done by some visual basic code)

The query which is the source of the list box works so that it displays just the results for that client, with this everything is perfect as an individual form.

However this form is a subform for another form and the subform is placed in a tab. And when i load the form it:

1. Can't find the field to filter the list box to each specific client.

2. When i double click on anything in the list table it displays an error "can't find the form 'frm_jobs' referred to in macro expression or visual basic code".

As it works perfectly when the forms loaded separatley. Im a bit stuck to what the problem maybe.

Thank you for any help.
 
Thanks for that.

If currently this was my code (below) and the subform appears in tabctrl14, page54 and subform is called 'frm_jobs'. Then would anyone be able to help me with what code i would have to add?

This is my code:

Private Sub List67_DblClick(Cancel As Integer)
On Error GoTo Err_List67_DblClick
Dim rs As Object

'Creates a clone of list67 on frm_jobs
Set rs = Forms!frm_jobs.Recordset.Clone
rs.FindFirst "Job_ID= " & Me.List67
Forms!frm_jobs.Bookmark = rs.Bookmark

Exit_List67_DblClick:
Exit Sub

Err_List67_DblClick:
MsgBox Err.Description, ,
Resume Exit_List67_DblClick

End Sub

Thank you for any help and advice.
 
Tab Controls and Pages do *not* affect the reference syntax. What form is the code being executed from? What is the name of the MainForm? Is the current form a SubForm of the MainForm?
 
The listbox is on frm_jobs. This is the subform.
The code is being executed from frm_jobs.
The subform appears on the frm_clients.

Thanks
 
Any chance of zipping up your db and posting it here? Remove any sensitive data but leave enough to demonstrate the problem.
 

Users who are viewing this thread

Back
Top Bottom