T
Tyler
I am setting up a database with three main forms. The parent form is called
[Orders]. The first subform is called [People]. the Second subform is called
[records]. Each order can have multiple people in it. Each person can have
multiple records. To keep all of the data on one page, I nested two
different subforms. The problem is that I am having problems running simple
functions on my second subform [records]. The first problem is using the
findrecord operation to find a value (MaxID) in the ID field. Here is what I
have:
Forms![Orders]![People].Form![Records].SetFocus
Forms![Orders]![People].Form![Records].Form![ID].SetFocus
DoCmd.FindRecord MaxID
The first two lines work (the ID field ends up having the focus), but the
last line gives me a runtime error. If I run this code slightly modified
with only one subform, it works fine.
The second problem is with an on_open event. When the entire form is loaded
I need to filter a field in the second nested form called [hide]. If [hide]
is true, I want that record filtered. I don't want to do it in the query,
because I want the user to have the oportunity to see all of the records.
Here is what I have:
Forms![Orders]![People].Form![Records].Filter = "[hide] = 0"
Forms![Orders]![People].Form![Records].FilterOn = True
If anyone knows what I am doing wrong I would appreciate it. Thanks for
your help.
[Orders]. The first subform is called [People]. the Second subform is called
[records]. Each order can have multiple people in it. Each person can have
multiple records. To keep all of the data on one page, I nested two
different subforms. The problem is that I am having problems running simple
functions on my second subform [records]. The first problem is using the
findrecord operation to find a value (MaxID) in the ID field. Here is what I
have:
Forms![Orders]![People].Form![Records].SetFocus
Forms![Orders]![People].Form![Records].Form![ID].SetFocus
DoCmd.FindRecord MaxID
The first two lines work (the ID field ends up having the focus), but the
last line gives me a runtime error. If I run this code slightly modified
with only one subform, it works fine.
The second problem is with an on_open event. When the entire form is loaded
I need to filter a field in the second nested form called [hide]. If [hide]
is true, I want that record filtered. I don't want to do it in the query,
because I want the user to have the oportunity to see all of the records.
Here is what I have:
Forms![Orders]![People].Form![Records].Filter = "[hide] = 0"
Forms![Orders]![People].Form![Records].FilterOn = True
If anyone knows what I am doing wrong I would appreciate it. Thanks for
your help.