Data doesn't show up in bound fields

L

LAS

I have a form with two bound fields. I create a new row and assign the
bound fields values, but they don't show up on the form. What do I need to
do to make them show up? Here's the code.

If (IsNull(cboStudent_ID) Or cboStudent_ID = "") Then
MsgBox ("Please choose a student.")
Exit Sub
End If
If IsNull(txtStartDate) Or txtStartDate = "" Then
MsgBox ("Please choose a date.")
Exit Sub
End If
Me.Requery

Set irst_StudentTracking = Me.Recordset

With irst_StudentTracking
If (.EOF = True) And (.BOF = True) Then
.AddNew
!Student_ID = cboStudent_ID
!Incident_Date = txtStartDate
End If
End With
 
J

Jeff Boyce

Why are you requerying the form?

What "Recordset"?

ADO or DAO?

Version of Access?

Is the FORM bound as well?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
L

LAS

This problem went away when I re-created the form from scratch, copying in
controls and scripts from the old form one by one.

For future reference, how do I find out whether I'm using ADO or DAO? When
you say "what recordset," how would I answer that? It's Me.Recordset.
Don't know of any othe way to qualify it.
 
J

Jeff Boyce

I'd probably check in the Modules, and look at which Reference was higher on
the list (DAO or ADO). Some versions of Access put DAO higher, others put
ADO higher.

I had never used the Me.Recordset property before, but it seems like it
should return all the records that are "feeding" the form or report in which
this code runs.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

David W. Fenton

I had never used the Me.Recordset property before, but it seems
like it should return all the records that are "feeding" the form
or report in which this code runs.

Me.Recordset is a reference to the actual recordset that's in the
form's edit buffer, so it will be absolutely identical, and changes
to its data and to record pointer will be immediately reflected in
the form itself.

These reasons are why I avoid ever using it.
 

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