Subform on TabControl

JPR

Registered User.
Local time
Today, 11:08
Joined
Jan 23, 2009
Messages
207
Hello,
I am designing a simple db and have created a main form (frmMenu) with a tab control with three pages. On each page, I have placed a different subform.

On page1, I have Subform1. This form gets its records from Table1 and has an unbound combo box that allows to move directly to the selected record.
What I would like to do is to open Page1 and view the SubForm1 blank without data. Users should select the record to view the entire recordset.

I would also like users to be able to modify or add data to this form but do not know what vba code to write down.
Can anyone help out with this? Appreciate your help.
 
Users should select the record to view the entire recordset.
Does that mean choose a combo box list item? Kind of hard to select a record on a form if there are none showing? Maybe what you need to do is apply a filter on subform load that causes no records to display, then modify the filter upon combo AfterUpdate event. Or use that event to set the subform recordsource property from nothing (in design view) to the table.

I don't understand the latter part of your post. If the subform is bound to a table as you say, no code is needed to modify or add records - unless you are doing something like opening the subform in a manner which doesn't allow that.
 
Hi JPR

Can you upload a zipped copy of the database?
 
There is no field in table named ID so how can it be used in filter criteria? Fix the Embedded Macro expression.

="[State] = '" & [Screen].[ActiveControl] & "'"
 
Hi

As June indicated your States table did not have an identifying ID . I added StateID asan Autonumber for the table.

Modified the Subform so that it was based on the Table and Not a Select statement.

Now works OK
 

Attachments

hello,
I have noticed your have changed the code in the macro and added to autonumber but there is still something confusing me.
If I open the form just as form (not from the frmMenu....meaning on the TAB) the combo, works fine although it should show no data (it shows test). If, I open the form regularly as a Subform, then it does not change the records. Thank you
 
Hi JPR
Don't know what happened there but here with the Form reworked
 

Attachments

Users who are viewing this thread

Back
Top Bottom