autofill not working property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a form on which there is a combo-box drop down from which users
select an account number. It contains 2 columns, the first being the account
number, and the second being the account name. Below this combo-box is a
text box (txt_account_name) that has thefollowing as the control source:

=[cbo_Account_No].[column](1)

It is supposed to automatically fill in the account name.

My problem is that it does sometimes and sometimes it doesn't. When the
account number has a leading zero, the account name is not filling in.

Can anyone tell me how to fix this problem? I have even removed the
formatting to get rid of the leading zero but it is still not autofilling.

Why would it even matter?

Thanks
 
Hi all,

I have a form on which there is a combo-box drop down from which users
select an account number. It contains 2 columns, the first being the account
number, and the second being the account name. Below this combo-box is a
text box (txt_account_name) that has thefollowing as the control source:

=[cbo_Account_No].[column](1)

It is supposed to automatically fill in the account name.

My problem is that it does sometimes and sometimes it doesn't. When the
account number has a leading zero, the account name is not filling in.

Can anyone tell me how to fix this problem? I have even removed the
formatting to get rid of the leading zero but it is still not autofilling.

Why would it even matter?

It shouldn't.

Two suggestions: Open the RowSource query for cbo_account_no in SQL
view and post the SQL here; and open it in datasheet view and see if
the second column in fact contains the account name that you expect.

John W. Vinson[MVP]
 
Hi John,

Here is the SQL from the Row Source of the cbo_Account_No combo box.

SELECT tbl_Account_master.Account_no, tbl_Account_master.Account_Name
FROM tbl_Account_master;

In addition, I opened the datasheet view of the query and there are only 2
columns, Account_No and Account_Name.

??????

Any other suggestions??

John Vinson said:
Hi all,

I have a form on which there is a combo-box drop down from which users
select an account number. It contains 2 columns, the first being the account
number, and the second being the account name. Below this combo-box is a
text box (txt_account_name) that has thefollowing as the control source:

=[cbo_Account_No].[column](1)

It is supposed to automatically fill in the account name.

My problem is that it does sometimes and sometimes it doesn't. When the
account number has a leading zero, the account name is not filling in.

Can anyone tell me how to fix this problem? I have even removed the
formatting to get rid of the leading zero but it is still not autofilling.

Why would it even matter?

It shouldn't.

Two suggestions: Open the RowSource query for cbo_account_no in SQL
view and post the SQL here; and open it in datasheet view and see if
the second column in fact contains the account name that you expect.

John W. Vinson[MVP]
 
Hi John,

Here is the SQL from the Row Source of the cbo_Account_No combo box.

SELECT tbl_Account_master.Account_no, tbl_Account_master.Account_Name
FROM tbl_Account_master;

In addition, I opened the datasheet view of the query and there are only 2
columns, Account_No and Account_Name.

Well, that's precisely what you're asking for: two fields, Account_No
and Account_Name. When you look down the list of accounts, do account
numbers with leading zeros have the correct account name? What are the
other relevant properties (Bound Column, Column Count, Column Widths)
of the combo box?

Your form might be corrupt. Try deleting this combo off the form
altogether, compacting the database, and recreating it. Something is
really wierd here!

John W. Vinson[MVP]
 
Hi John,

I've figured it out. I imported a new Account_Master table and in the
import the data type for the account number was imported as text where and
the database has the account number as "number". Once I changed it back to
number in the account master, it worked fine. I just need to make sure that
the account master gets imported properly next time.

Thank you for your help!
 
Hi John,

I've figured it out. I imported a new Account_Master table and in the
import the data type for the account number was imported as text where and
the database has the account number as "number". Once I changed it back to
number in the account master, it worked fine. I just need to make sure that
the account master gets imported properly next time.

You may want to make it Text consistantly; if you want to use leading
zeros that's essentially obligatory in fact.


John W. Vinson[MVP]
 
Back
Top