Form changes not being saved to table

G

Guest

Help

I have a main form that has no recordsource (unbound form?). This form has a calendar control that is used to pass a date to an unbound text box (txtWhatDate). This form has a subform on it whose recordsource is a Select query whose SQL is as follows

SELECT tblDays2004.fldDate, tblTeeTimes2004.fldTeeTime, tblTeeTimes2004.fldPlayer1, tblTeeTimes2004.fldPlayer2, tblTeeTimes2004.fldPlayer3, tblTeeTimes2004.fldPlayer4, tblTeeTimes2004.fldPowerCart, tblTeeTimes2004.fldOnCours
FROM tblDays2004 INNER JOIN tblTeeTimes2004 ON tblDays2004.ID = tblTeeTimes2004.fldDateI
ORDER BY tblDays2004.fldDate, tblTeeTimes2004.fldTeeTime

When a date is selected from the calendar control the recordsource for the subform is set to

'Set RecordSource for the TeeTimes SubFor
Me.frmQBF_TeesByDateSubForm.Form.RecordSource =
"Select * from qryQBF_TeesByDate2004 Where fldDate = #"
& ctlCalPickDay.Value & "#

This seems to work fine, at least in that the calendar controls the subform and the subform displays the subset of records for that date only

The problem is that the table tblTeeTimes2004 in which the form allows Players to be entered in existing records to complete the tee time slot does not seem to be updating consistently. When I make changes in the form and then check the table, the changes are often not made (although in other cases they are)

Sorry for the long winded explanation but I am beat

Thanks so much for your help.
 
G

Graham Mandeno

Hi Bob

Why don't you link the form and subform using the date field. For the
subform control, set LinkMasterFields to txtWhatDate (the name of the
textbox containing the date) and set LinkChildFields to fldDate.

That way, you won't have to keep changing the RecordSource, and when you add
records to your subform, fldDate will automatically be populated with the
correct date.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Bob Mullen said:
Help.

I have a main form that has no recordsource (unbound form?). This form has
a calendar control that is used to pass a date to an unbound text box
(txtWhatDate). This form has a subform on it whose recordsource is a Select
query whose SQL is as follows:
SELECT tblDays2004.fldDate, tblTeeTimes2004.fldTeeTime,
tblTeeTimes2004.fldPlayer1, tblTeeTimes2004.fldPlayer2,
tblTeeTimes2004.fldPlayer3, tblTeeTimes2004.fldPlayer4,
tblTeeTimes2004.fldPowerCart, tblTeeTimes2004.fldOnCourse
FROM tblDays2004 INNER JOIN tblTeeTimes2004 ON tblDays2004.ID = tblTeeTimes2004.fldDateID
ORDER BY tblDays2004.fldDate, tblTeeTimes2004.fldTeeTime;

When a date is selected from the calendar control the recordsource for the subform is set to:

'Set RecordSource for the TeeTimes SubForm
Me.frmQBF_TeesByDateSubForm.Form.RecordSource = _
"Select * from qryQBF_TeesByDate2004 Where fldDate = #" _
& ctlCalPickDay.Value & "#"

This seems to work fine, at least in that the calendar controls the
subform and the subform displays the subset of records for that date only.
The problem is that the table tblTeeTimes2004 in which the form allows
Players to be entered in existing records to complete the tee time slot does
not seem to be updating consistently. When I make changes in the form and
then check the table, the changes are often not made (although in other
cases they are).
 

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