Subforms not picking up the date from main form Access 02/03

P

Presto

I have a member data entry form with two subforms.
The main form has a combobox in the header to select a meeting date.
On the two subforms, there are date fields that should correspond to the
meeting date.
The subforms are properly linked via a primary key.

I get #Error in both these fields so I know it's not seeing the date on the
combobox.

heres the fields:
Form name: NewMemberEntryForm
control name: cboMeetingDate
Payment_subform control name : pmtdate
History_subform control name : historydate

The data source code for both fields is (under default value):
=[Forms]![NewMemberDataEntry]![cboMeetingDate]

What am I missing here?? Any help would be appreciated.
 
P

Presto

My error... the main form name is NewMemberDataEntry
should I be using dots or !
 
M

Mike Painter

Presto said:
I have a member data entry form with two subforms.
The main form has a combobox in the header to select a meeting date.
On the two subforms, there are date fields that should correspond to
the meeting date.
The subforms are properly linked via a primary key.

I get #Error in both these fields so I know it's not seeing the date
on the combobox.

heres the fields:
Form name: NewMemberEntryForm
control name: cboMeetingDate
Payment_subform control name : pmtdate
History_subform control name : historydate

The data source code for both fields is (under default value):
=[Forms]![NewMemberDataEntry]![cboMeetingDate]

What am I missing here?? Any help would be appreciated.

If these are related tables there is really no need to show the date in the
subform tables.

However the default calue property of Access is "poor" to be polite. The
value has to exist early on in the opening of the form and probably will not
work here
 
M

Marshall Barton

Presto said:
I have a member data entry form with two subforms.
The main form has a combobox in the header to select a meeting date.
On the two subforms, there are date fields that should correspond to the
meeting date.
The subforms are properly linked via a primary key.

I get #Error in both these fields so I know it's not seeing the date on the
combobox.

heres the fields:
Form name: NewMemberEntryForm
control name: cboMeetingDate
Payment_subform control name : pmtdate
History_subform control name : historydate

The data source code for both fields is (under default value):
=[Forms]![NewMemberDataEntry]![cboMeetingDate]

What am I missing here?? Any help would be appreciated.


Aside from the question of why you are saving the same date
in two related tables. There are a couple of things you
need to be aware of. The first is that all but the bound
column of combo/list boxes are text strings so you might(?)
be able to get away with using this default value:
CDate(Forms!NewMemberDataEntry!cboMeetingDate)

NOTE: The DefaultValue property is not evaluated/applied
until the first character is typed into a **new** record so
you might not see the real value until you start to enter a
value.

The other thing is that if the main form - subform must have
the same date then you could set the LinkMaster/Child
properties to use both the ID and the date fields

Master: mainIDfield, cboMeetingDate
Child: subIDfield, datefield

This approach would take care of filling in the value
automatically so the default value would not be used in the
subform.
 

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