473,395 Members | 1,936 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,395 software developers and data experts.

Using a combo box to prefil other fields

I have a form where the user selects a client name originally from a
table and then proceeds to complete other details in a sub form. The
users asked to see two pieces of information relating to the client on
this form, both of which are stored in the client table. As I had
never done this before I found out via this group how to create a
combo box called claimClientName that got its data from a query and it
is bound to column 1 of that query. This works fine.

I then created a new field and the source is

=claimClientName.Column(1)

This also works fine. I read here that the number of the column should
assume that the first column is 0 so the data that is in the field is
in fact column 2 if you just run the query.

So, on to the second piece of data. I copied the field and just
changed the source to

=claimClientName.Column(2)

Nothing doing...

I've re-created the field from scratch in case I copied something that
shouldn't be there but the same thing happens i.e. nothing. No error
message, no data, just a blank field.

I can't seem to find anything wrong but I cannot get the second field
to function. I have tried changing the column order in the query but
that just changes the data that appears in the field that works. I've
tried making the two fields identical and they then both display the
same column data i.e. column 1. If I change the fields to both look at
column 2 then neither work.

I've changed the code to =claimClientName.Column(0)and this puts the
data from the first query column (the client name) in the field.

There definitely is data in the problem column just in case anyone
wondered!!!

Is there some restriction on the number of columns this method works
for? I've tried every different permutation of columns but I can't get
it to work. I've changed it also to =claimClientName.Column(3) (not
sure why, clutching at straws) and this is blank as you would expect.

Would appreciate any ideas

Regards

Michelle
Nov 12 '05 #1
1 2965
Michelle,

You need to set the ColumnCount property of the combobox to the max number of
columns you want to use with the Column(x) property. =claimClientName.Column(1)
works because your ColumnCount property is set to 2. =claimClientName.Column(2)
does not work because ColumnCount property is set to 2 and you are specifying
the third column. Change the ColumnCount property to 3 and
=claimClientName.Column(2) will work.

Note: When you change the ColumnCount property to 3, be sure to also add the
ColumnWidth for column 3.

The ColumnCount and ColumnWidth properties are found under the Format tab of
properties for the combobox.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com
"Michelle Collier-Moore" <mi******************@hotmail.com> wrote in message
news:68**************************@posting.google.c om...
I have a form where the user selects a client name originally from a
table and then proceeds to complete other details in a sub form. The
users asked to see two pieces of information relating to the client on
this form, both of which are stored in the client table. As I had
never done this before I found out via this group how to create a
combo box called claimClientName that got its data from a query and it
is bound to column 1 of that query. This works fine.

I then created a new field and the source is

=claimClientName.Column(1)

This also works fine. I read here that the number of the column should
assume that the first column is 0 so the data that is in the field is
in fact column 2 if you just run the query.

So, on to the second piece of data. I copied the field and just
changed the source to

=claimClientName.Column(2)

Nothing doing...

I've re-created the field from scratch in case I copied something that
shouldn't be there but the same thing happens i.e. nothing. No error
message, no data, just a blank field.

I can't seem to find anything wrong but I cannot get the second field
to function. I have tried changing the column order in the query but
that just changes the data that appears in the field that works. I've
tried making the two fields identical and they then both display the
same column data i.e. column 1. If I change the fields to both look at
column 2 then neither work.

I've changed the code to =claimClientName.Column(0)and this puts the
data from the first query column (the client name) in the field.

There definitely is data in the problem column just in case anyone
wondered!!!

Is there some restriction on the number of columns this method works
for? I've tried every different permutation of columns but I can't get
it to work. I've changed it also to =claimClientName.Column(3) (not
sure why, clutching at straws) and this is blank as you would expect.

Would appreciate any ideas

Regards

Michelle

Nov 12 '05 #2

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

Similar topics

4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
5
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
7
by: Megan | last post by:
Hi everybody- I inherited a database that somehow uses a bound combo box as a record selector. Let me give you some background. The form is based on data from 2 tables. The first table, Person,...
4
by: bill.brennum | last post by:
Hi, This is probably a question with a simple answer, but here goes. I have a form linked to a table. There is a field on that table that while not showing on the form, I would like to...
1
by: Arun | last post by:
Hi Group, I was trying to link a combo box with a list control and having some trouble with that. Could anyone please help me with that. Here's the example of the scenario. Combo Box ;-...
3
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key...
6
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main...
1
by: Jason Northampton | last post by:
Hello This is the first time I've used a discusion forum and up until now I have managed to use and or modify VB code from the various sites on the web, until now! This is a simple problem and I...
8
by: banderson | last post by:
Hello, I have a combo box in which I want to display multiple fields by concatenating the fields together. If one of those concatenated fields is Null, then the combo box does not show anything. To...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.