No data entered in table

  • Thread starter goeppngr via AccessMonster.com
  • Start date
G

goeppngr via AccessMonster.com

I have a form that the user enters data into the database detail section as
below:

Machine #
Shift #
Tons
Waste

On the form I have in the header an unbound date field. This date is linked
to update the detail date on the form (I did not want the user to have to
enter the date for each production entry). All of this data goes into my
prodTable. If the user fails to enter the date (in the header section), none
of the data that was entered into the detail section is stored in my table.
Why?

Thanks!
 
B

Bill

You haven't quite told us enough. If on your form you have text boxes
bound to table fields that are defined by the underlying RecordSource
of the form, then those fields would get updated unless you've set things
up to prohibit updates.

Tell us about the properties of the form. Is the form "continuous"? If not,
is the "date" field serving as the record key, etc.

As an aside, you might want to be careful using the pound sign "#" in
naming. In some contexts, Access might not treat it the way you intended
and SQL will likely reject its use in several contexts.

Bill
 
B

Bill

(PS) I'll be unavailable all day, but it's likely that someone else
will pick this up during the day. I'll check tonight.
Bill

Bill said:
You haven't quite told us enough. If on your form you have text boxes
bound to table fields that are defined by the underlying RecordSource
of the form, then those fields would get updated unless you've set things
up to prohibit updates.

Tell us about the properties of the form. Is the form "continuous"? If
not,
is the "date" field serving as the record key, etc.

As an aside, you might want to be careful using the pound sign "#" in
naming. In some contexts, Access might not treat it the way you intended
and SQL will likely reject its use in several contexts.

Bill
 
G

goeppngr via AccessMonster.com

The header contains the date text box that is unbound.
The deatil section contains a date text box that has the default value set to
the value in the unbound contorl, and then that date text boxs' control
source is a date field in my table.
All other text boxes in the form have a control source that is in my table.

The form is a single form and the date is not set as the primary key.

below is the code I have behind the form:

Private Sub Form_BeforeUpdate(Cancel As Integer)
txtProdDate.Value = txtHeadDate
End Sub

Private Sub Form_Current()
Call Calender_or_PM
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me.txtHeadDate.SetFocus
txtHeadDate.Text = ""
End Sub

Private Sub Machine_BeforeUpdate(Cancel As Integer)
Call Calender_or_PM
End Sub

Private Sub Machine_Change()
Call Calender_or_PM
End Sub

Private Sub Text20_GotFocus()
Me.Machine.SetFocus
End Sub
Private Sub Calender_or_PM()
If Machine.Value = "214" Or Machine.Value = "215" Then
Rerolls.Enabled = True
Sheets.Enabled = True
SCF.Enabled = False
Else
Rerolls.Enabled = False
Sheets.Enabled = False
SCF.Enabled = True

End If

End Sub
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click


DoCmd.Close

Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click

End Sub

Please advise of any furhter information required.

(PS) I'll be unavailable all day, but it's likely that someone else
will pick this up during the day. I'll check tonight.
Bill
You haven't quite told us enough. If on your form you have text boxes
bound to table fields that are defined by the underlying RecordSource
[quoted text clipped - 31 lines]
 
G

goeppngr via AccessMonster.com

goeppngr said:
The header contains the date text box that is unbound.
The deatil section contains a date text box that has the default value set to
the value in the unbound contorl, and then that date text boxs' control
source is a date field in my table.
All other text boxes in the form have a control source that is in my table.

The form is a single form and the date is not set as the primary key.

below is the code I have behind the form:

Private Sub Form_BeforeUpdate(Cancel As Integer)
txtProdDate.Value = txtHeadDate
End Sub

Private Sub Form_Current()
Call Calender_or_PM
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me.txtHeadDate.SetFocus
txtHeadDate.Text = ""
End Sub

Private Sub Machine_BeforeUpdate(Cancel As Integer)
Call Calender_or_PM
End Sub

Private Sub Machine_Change()
Call Calender_or_PM
End Sub

Private Sub Text20_GotFocus()
Me.Machine.SetFocus
End Sub
Private Sub Calender_or_PM()
If Machine.Value = "214" Or Machine.Value = "215" Then
Rerolls.Enabled = True
Sheets.Enabled = True
SCF.Enabled = False
Else
Rerolls.Enabled = False
Sheets.Enabled = False
SCF.Enabled = True

End If

End Sub
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click

DoCmd.Close

Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click

End Sub

Please advise of any furhter information required.
(PS) I'll be unavailable all day, but it's likely that someone else
will pick this up during the day. I'll check tonight.
[quoted text clipped - 5 lines]

txtHeadDate is the header date field that is unboung
ProdDate is the date that has the default value linked to the header date.
Other field (Sheets, rerolls, SCF) are entry fields that are not stored.
 
B

Bill

Sorry to have seemingly disappeared, as I quite suddenly
and regrettably became totally unavailable.

Did you get your puzzle resolved?

Bill


Bill said:
(PS) I'll be unavailable all day, but it's likely that someone else
will pick this up during the day. I'll check tonight.
Bill
 

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