PC Review


Reply
Thread Tools Rate Thread

appending unbound combo query data to new record

 
 
MarkyMark
Guest
Posts: n/a
 
      8th Mar 2010
This may be covered elsewhere, but my understanding of how to phrase the
question is limited at best.

To set the scene - this is a dB for a weekly running club.

I have a table "RunDetails" (holds details of runners in an event) which has
a lookup field (the date) bound to table "Runs" (details of the event itself).

Form PersData displays the details of runners (name, etc). On this form I
have two unbound texboxes (Bib and Distance) and a date combobox
(cbo.rowsource is query from table 'Runs') and a button to enter their ID,
and the contents of these unbound boxes into table RunDetails.

The only thing that doesn't work is transferring the combobox date into
rundetails as I get a "13- type mismatch" error. I suspect that I am not
referencing the query correctly:

rst.AddNew
rst!RunnerID = IDRef
rst!RunnerBib = Me.EventBibNo
rst!RunnerDistance = Me.EventDistance
rst!RunID = Me.CurrentEventDate!RunID 'This is the bit thats wrong!

Can anyone offer some guidance?

 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      8th Mar 2010
On Mon, 8 Mar 2010 05:15:01 -0800, MarkyMark
<(E-Mail Removed)> wrote:

Speculating I think CurrentEventDate is a dropdown with runs. It
should have a first (likely hidden) column of RunID, BoundColumn set
to 1, and one or more additional visible columns (RunName, RunDate).
If that's correct the line of code should be:
rst!RunID = Me.CurrentEventDate

The bigger question is why you are doing this unbound. Access works
great in bound scenarios, without the need to write code.

-Tom.
Microsoft Access MVP


>This may be covered elsewhere, but my understanding of how to phrase the
>question is limited at best.
>
>To set the scene - this is a dB for a weekly running club.
>
>I have a table "RunDetails" (holds details of runners in an event) which has
>a lookup field (the date) bound to table "Runs" (details of the event itself).
>
>Form PersData displays the details of runners (name, etc). On this form I
>have two unbound texboxes (Bib and Distance) and a date combobox
>(cbo.rowsource is query from table 'Runs') and a button to enter their ID,
>and the contents of these unbound boxes into table RunDetails.
>
>The only thing that doesn't work is transferring the combobox date into
>rundetails as I get a "13- type mismatch" error. I suspect that I am not
>referencing the query correctly:
>
>rst.AddNew
>rst!RunnerID = IDRef
>rst!RunnerBib = Me.EventBibNo
>rst!RunnerDistance = Me.EventDistance
>rst!RunID = Me.CurrentEventDate!RunID 'This is the bit thats wrong!
>
>Can anyone offer some guidance?

 
Reply With Quote
 
TomcatKzn
Guest
Posts: n/a
 
      8th Mar 2010


"MarkyMark" wrote:

> This may be covered elsewhere, but my understanding of how to phrase the
> question is limited at best.
>
> To set the scene - this is a dB for a weekly running club.
>
> I have a table "RunDetails" (holds details of runners in an event) which has
> a lookup field (the date) bound to table "Runs" (details of the event itself).
>
> Form PersData displays the details of runners (name, etc). On this form I
> have two unbound texboxes (Bib and Distance) and a date combobox
> (cbo.rowsource is query from table 'Runs') and a button to enter their ID,
> and the contents of these unbound boxes into table RunDetails.
>
> The only thing that doesn't work is transferring the combobox date into
> rundetails as I get a "13- type mismatch" error. I suspect that I am not
> referencing the query correctly:
>
> rst.AddNew
> rst!RunnerID = IDRef
> rst!RunnerBib = Me.EventBibNo
> rst!RunnerDistance = Me.EventDistance
> rst!RunID = Me.CurrentEventDate!RunID 'This is the bit thats wrong!
>
> Can anyone offer some guidance?


Are you sure that you are returning the date value and not some other value.
Check the combo box properties to see what you are returning - the "Bound
column" Box.

 
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
How to make unbound combo box select all if related query record is null rocketD Microsoft Access 1 22nd Oct 2010 04:38 PM
Appending to a data record BillA Microsoft Access Queries 1 12th Nov 2009 07:20 PM
Appending a field with data using combo box =?Utf-8?B?Yl9hX3JlZG1hbg==?= Microsoft Access Form Coding 2 27th Jun 2007 03:58 PM
Unbound combo box display current record BruceM Microsoft Access Forms 2 10th Oct 2005 01:36 PM
Appending a record to a table based on an input on a form combo bo =?Utf-8?B?ZnJlZGR5bW9u?= Microsoft Access Macros 0 20th Sep 2004 10:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:01 PM.