473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Unbound Combobox not displaying data as expected ... need HELP, please.


Greetings!

Still the same application (as previous posts). I worked on the app
while at work (don't tell my boss ... cause this is just for fun and not
work related) and the form was working, but now when I try to repeat the
code at home (for real) it won't work. I suspect that I haven't
replicated the logic and forms at home from what I remember that I did
while at work.

My subform is based on a table called "tblTrialClass" and it has a bound
control called [classID]. [classID] is a FK from "tblClasses". The
values are 1, 2, 3 representing the text "Novice", "Open", "Utility".
The [classID] control's VISIBLE property is set to False.
The subform, also, has an unbound combobox called [cboClass]. The
recordsource is:

SELECT tblClasses.classID, tblClasses.class
FROM tblClasses
ORDER BY tblClasses.classID;

First column has a width of 0", so the dropdown only shows the text.
Bound column is the first column (classID).

The table called "tblClasses" has two columns: classID (autonumber, key)
and class (text).

The subform has the following VBA code behind it:

Private Sub cboClass_AfterUpdate()
Me![classID] = Me!cboClass.Column(0)
End Sub

Private Sub cboJudge_AfterUpdate()
Me![judgeID] = Me!cboJudge.Column(0)
End Sub

Private Sub Form_Current()
Me![cboClass] = Me![classID]
Me![cboJudge] = Me![judgeID]
End Sub

(I haven't mentioned the Judge fields, but they have the same problem)

When the form is opened, whether dynamically by the outter parent form,
or manually by me when testing the subform; [cboClass] has "Novice"
displaying for all records, even though the value of [classID] is not
always = 1. I tested this out by making the [classID] visible to verify
the data.

QUESTION:
How do I synchronize the combobox data with the bound integer field
[classID]?

I am pulling my hair out on this one. It's so simple, I'm sure.

Thanks,
SueB
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
2 2491
rkc
Susan Bricker wrote:
Greetings!

Still the same application (as previous posts). I worked on the app
while at work (don't tell my boss ... cause this is just for fun and not
work related) and the form was working, but now when I try to repeat the
code at home (for real) it won't work. I suspect that I haven't
replicated the logic and forms at home from what I remember that I did
while at work.

My subform is based on a table called "tblTrialClass" and it has a bound
control called [classID]. [classID] is a FK from "tblClasses". The
values are 1, 2, 3 representing the text "Novice", "Open", "Utility".
The [classID] control's VISIBLE property is set to False.
The subform, also, has an unbound combobox called [cboClass]. The
recordsource is:

SELECT tblClasses.classID, tblClasses.class
FROM tblClasses
ORDER BY tblClasses.classID;

First column has a width of 0", so the dropdown only shows the text.
Bound column is the first column (classID).

The table called "tblClasses" has two columns: classID (autonumber, key)
and class (text).

The subform has the following VBA code behind it:

Private Sub cboClass_AfterUpdate()
Me![classID] = Me!cboClass.Column(0)
End Sub

Private Sub cboJudge_AfterUpdate()
Me![judgeID] = Me!cboJudge.Column(0)
End Sub

Private Sub Form_Current()
Me![cboClass] = Me![classID]
Me![cboJudge] = Me![judgeID]
End Sub

(I haven't mentioned the Judge fields, but they have the same problem)

When the form is opened, whether dynamically by the outter parent form,
or manually by me when testing the subform; [cboClass] has "Novice"
displaying for all records, even though the value of [classID] is not
always = 1. I tested this out by making the [classID] visible to verify
the data.

QUESTION:
How do I synchronize the combobox data with the bound integer field
[classID]?


Get rid of your unbound controls.

Make your classID control a combobox instead of a textbox. Keep it
bound to the classID field, make it visible, set it's rowsource
property to tblClasses, colum count to 2 and column widths to 0;1.

That's all there is to it. You don't need your afterupdate or current
events code. Access handles the updates and displays the correct text
for you.

Nov 13 '05 #2

rkc,

Thank you for your input and patience. Your suggestions worked. Now I
can get on with the rest of my day!!! (I was going to stick with this
until I got it to work). Maybe I shouldn't thank you ... I have lots of
housecleaning and errands to do.

Thanks again.
Regards,
SueB
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
3
by: Dos Lil | last post by:
I have a unbound field in the subform(for calculating the datediff) which has the control property ==DateDiff("n",,). I have another unbound field in the main form which is for displaying the...
7
by: Susan Bricker | last post by:
Sorry..I keep hitting the wrong key and sending the post too soon... The problem: COMBOBOX not displaying all possible rows. The RecordSource (generated by SQL view of the Query Builder) is:...
6
by: Doug Bell | last post by:
Hi I have a datagrid with a combo box, I need to populate the combo with data dependant on the record value. eg for record 1, field Warehouse = 2R so combo would allow selection of locations...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
3
by: Richard | last post by:
How is the result of query placed in a unbound textbox ? Suppose CriteriaLookups has columns TableName, KeyColumn, KeyValue, DataColumn Foo,x,11,xhat Bar,z,3,xyzzy And
6
by: Volker Neurath | last post by:
Hi all, I have a Problem with combobox-property "NotInList" and an unbound Form. The situation: On my main form i have three comboboxes for data-exchange (here: Names of distributor,...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.