New Tab

  • Thread starter Thread starter Bruce Rodtnick
  • Start date Start date
B

Bruce Rodtnick

I have a form with two tabs, Page1 and Page2. Page 2 has a subForm on
it (subWorkshops) and the first control is a ComboBox (cboWorkshop).

When I enter a new Record in Page1 and go immediately to Page2,
cboWorkshop will not let me in. Only after I come off that record and
come back onto it can I get into Page2 cboWorkshop.

I figure that the record must be saved to the table before Page2 knows
there is a record behind it that cboWorkshop can link to. I've tried:

If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

In Name.AfterUpdate

But it still does not let me in to cboWorkshop even though the record is
saved to the table.

How can I get this Combo Box let me in?

Bruce Rodtnick
 
I have a form with two tabs, Page1 and Page2. Page 2 has a subForm on
it (subWorkshops) and the first control is a ComboBox (cboWorkshop).

The Tab Control is irrelevant: it just controls how the information is
laid out on the screen. The subform, on the other hand, very well may
be relevant.
When I enter a new Record in Page1 and go immediately to Page2,
cboWorkshop will not let me in. Only after I come off that record and
come back onto it can I get into Page2 cboWorkshop.

Odd. What are the Recordsource properties of the main form and the
subform? What's the Control Source and Rowsource of cboWorkshop? What
are the master/child link fields of the subform?
I figure that the record must be saved to the table before Page2 knows
there is a record behind it that cboWorkshop can link to. I've tried:

Normally setting focus to a subform (whether it's on a tab page or
not) automatically saves the record, so this is "belt and braces" -
won't hurt but it shouldn't be necessary.
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

In Name.AfterUpdate

But it still does not let me in to cboWorkshop even though the record is
saved to the table.

How can I get this Combo Box let me in?

Just what do you mean by "let you in"? What error message (or
misbehavior) are you getting?
 
Bruce,

Normally, the main form record would automatically be saved as soon as
you move to the subform. What exactly is the relationship between the
main form and the subform? Also, I don't understand the concept
"cboWorkshop will not let me in"... do you mean you can't put the cursor
in there by clicking with the mouse, or do you mean the combobox's list
won't drop down, or something else?
 
Bruce,

Do you mean that the combo box does not display the new
record that's just been saved to the table?

If so, then you need to requery the combo box to refresh it
from it's source.
 
John said:
The Tab Control is irrelevant: it just controls how the information is
laid out on the screen. The subform, on the other hand, very well may
be relevant.


Odd. What are the Recordsource properties of the main form and the
subform? What's the Control Source and Rowsource of cboWorkshop? What
are the master/child link fields of the subform?

The Recordsource properties for the main form is a query of the Personnel
Table. The Recordsource of the subWorkshops is a query on the table
WorkshopAttendance. The master/child link fields of the subform is
ContactID.
Normally setting focus to a subform (whether it's on a tab page or
not) automatically saves the record, so this is "belt and braces" -
won't hurt but it shouldn't be necessary.


Just what do you mean by "let you in"? What error message (or
misbehavior) are you getting?

No error message. It's like it's greyed out. I click on it and it does
nothing.
 
Mainform and subform are linked by the ContactID

cboWorkshop is like it's greyed out. I click on it and it does nothing.

I used your code you gave me on tabbing from one page to the other and it
worked on records that are already in, but on a new record it gives me anerror
"Can't find subWorkshops"

My code to enter a new record is:

DoCmd.RunCommand acCmdRecordsGoToNew
 
Back
Top