Filtering a table based subform

C

chazhead

Hi All

I'm stuck & I need help please.

Please excuse me if I use incorrect terms etc. as I am most definatly
NOT an Access developer, more a frustrated PM trying to make somthing
work :)

What am I trying to do?
I am trying to buld a form that will let me update/add records to a
table, but only show the records in the table filtered by the criteria
of a combo box.

What elements have I got?
A table called 'tbl_project_main' with the field 'Project_ID' as the
unique identifer (primary key).
A sub-form called 'frm_ledger' which is a continuous form with the
data source being 'tbl_project_main'.
A parent form called 'frm_ledger_update' which is a single form with
the data source being 'tbl_project main'

What have I done so far?
I have created a parent child link on the field 'Project_ID' between
the parent form (frm_ledger_update) and the child form (frm_ledger).
In the parent form I have created a combo box called 'proj_list' that
looks up the 'Project_ID' from 'tbl_project_main' and have used an
after update event that works as I want in that it filters the records
in the child form and lets me add & update records without issue. The
AfterUpdate code is as follows:

Private Sub proj_list_AfterUpdate()

If Not IsNull(proj_list) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[Project_ID] = " & Me.proj_list
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub


So what's the problem?
Well, I have created another unbound form called 'frm_project_main' in
which I have created a 'Tab Control' element called 'TabCtl29' and on
the tab called 'Page30' I have added a sub form of 'frm_ledger_update'
and when I try and use that form on the tab, I get the NoMatch return
of 'Not found: Filtered'. I'm sure it is to do with Me. in the code
not working correctly as the form is now a child of another form (I
may also be totally wrong) but I do not know how to fix the code to
reflect this.

Does anyone know what I am doing wrong?


Thanks.
Chaz.
 

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