Access (Sub)form

RAWK

New Member
Hi there,
I’ve got 2 questions about Access.

First one. I’m using a form and subform. For some records of the form, the subform is empty. I want to make sure that the form doesn’t show these records of the form. So when the subform of the record is empty, don’t show te subform and record at all.

Second one. I’m making use of a datasheetform and a standardform based on the same query. The datasheetform serves as an overview and the standardform is there for editing the record and see more details. In the query is a field called [ID]. When I doubleclick on the ID of a record in the datasheetform I want Access to open the standardform on that same record with the same ID. Is there someone who can help me with the code I need to write fort his?

Hope you understand what I mean!

Kind regards
 
I think the easiest way would be to make your form, use the standard GUI tools to draw out the fields you need. Then set the controls to be bound. It's a property that you can access for each field through the GUI. This will make them tied to your database fields. Do the same for the subform. Then to open the subform, just add a OnDblClick() event to view the subform and set it's id field to the same ID as the record you were looking at.

From the docs, it looks like you want DoCmd.OpenForm

If that makes sense....

To bind a field you do something similar to what you see below.

rs.jpg
 
Back
Top