PC Review


Reply
Thread Tools Rate Thread

Data doesn't show up in bound fields

 
 
LAS
Guest
Posts: n/a
 
      3rd Aug 2010
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


 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      3rd Aug 2010
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.

"LAS" <(E-Mail Removed)> wrote in message
news:i37rd1$qio$(E-Mail Removed)...
>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
>



 
Reply With Quote
 
LAS
Guest
Posts: n/a
 
      4th Aug 2010
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.

"Jeff Boyce" <(E-Mail Removed)> wrote in message
news:i39gof$ths$(E-Mail Removed)...
> 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.
>
> "LAS" <(E-Mail Removed)> wrote in message
> news:i37rd1$qio$(E-Mail Removed)...
>>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
>>

>
>



 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      5th Aug 2010
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.

"LAS" <(E-Mail Removed)> wrote in message
news:i3c0n6$ci2$(E-Mail Removed)...
> 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.
>
> "Jeff Boyce" <(E-Mail Removed)> wrote in message
> news:i39gof$ths$(E-Mail Removed)...
>> 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.
>>
>> "LAS" <(E-Mail Removed)> wrote in message
>> news:i37rd1$qio$(E-Mail Removed)...
>>>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
>>>

>>
>>

>
>



 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      6th Aug 2010
"Jeff Boyce" <(E-Mail Removed)> wrote in
news:i3fdst$1v5$(E-Mail Removed):

> 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.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allowing users to change data in bound fields on form =?Utf-8?B?amRhc25vaXQ=?= Microsoft Access Forms 2 4th Jan 2006 08:29 PM
Issue with data bound fields on Tab Control Aparna Rege Microsoft VB .NET 1 26th Oct 2004 09:17 AM
How to initialise data bound fields for entry of a new record Joshua Ellul Microsoft ADO .NET 4 17th Oct 2003 06:16 PM
Bound data doesn't change with dataset. M K Microsoft Dot NET Framework Forms 4 13th Jul 2003 01:31 PM
Re: Bound data doesn't change with dataset. Mark Kenyon II Microsoft Dot NET Framework Forms 0 8th Jul 2003 09:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 AM.