auto fill

K

kylesalone

I have two fields.
One is a combo box name "salesman"
the other is a text field called "office"
I want the "office" field to autofill in the text needed when the salesman
is selected from the first field. i.e. If I put in "Jeff G" in the salesman
field... I would like "ATL" to automatically be in the Office field. If "john
L" is selected in the salesman field I would automatically need his
particular office to be in the office field for him...
I need these fields to be two seperate fields, because I run querrys with
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

If you have a table that lists salesmen and offices and you are using it to
populate the combo box, include both fields. Then use the combo box's
AfterUpdate event to set the text box:

Me.TextBox = Me.ComboBox.Column(1)
 
K

kylesalone

I have a combo box named <salesman>. Once that is selected, I would like the
text box field named <office> to auto fill.
Thanks
 
K

kingston via AccessMonster.com

What is the row source for the combo box? IOW, where do the selections come
from? When you build a combo box, the wizard asks for a data set. If the
data set is a table with salesman and office, choose both fields instead of
just one. Your combo box will then have two columns instead of one. Then
use the combo box's After Update event to create a procedure that populates
the text box with the data in column two of the combo box.

If you do not have a datatable where salesman and office are paired, what is
the logic for office selection?
I have a combo box named <salesman>. Once that is selected, I would like the
If you have a table that lists salesmen and offices and you are using it to
populate the combo box, include both fields. Then use the combo box's
[quoted text clipped - 13 lines]
 
K

kylesalone

I have two different tables. Because I run a querry with each field in two
seperate querries. One table for salesman was created so I could make a combo
box for it. I have since created another table for the office field so I can
make a combo box for that if it will make this easier... IDK if it will or
not. I am just trying to cut down on user data entry errors. So, what I am
trying to accomplish is... when I select a <salesman> from the combo box in a
form... that the <office> will auto fill with the appropriate data. Thanks
so much.
Kyle

kingston via AccessMonster.com said:
What is the row source for the combo box? IOW, where do the selections come
from? When you build a combo box, the wizard asks for a data set. If the
data set is a table with salesman and office, choose both fields instead of
just one. Your combo box will then have two columns instead of one. Then
use the combo box's After Update event to create a procedure that populates
the text box with the data in column two of the combo box.

If you do not have a datatable where salesman and office are paired, what is
the logic for office selection?
I have a combo box named <salesman>. Once that is selected, I would like the
If you have a table that lists salesmen and offices and you are using it to
populate the combo box, include both fields. Then use the combo box's
[quoted text clipped - 13 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
salesman always use the same office? Is there a search required to find an
available office? No matter what the logic is, you'll probably need to use
the combo box's AfterUpdate event to populate the text box once a selection
is made. Does this make sense?
I have two different tables. Because I run a querry with each field in two
seperate querries. One table for salesman was created so I could make a combo
box for it. I have since created another table for the office field so I can
make a combo box for that if it will make this easier... IDK if it will or
not. I am just trying to cut down on user data entry errors. So, what I am
trying to accomplish is... when I select a <salesman> from the combo box in a
form... that the <office> will auto fill with the appropriate data. Thanks
so much.
Kyle
What is the row source for the combo box? IOW, where do the selections come
from? When you build a combo box, the wizard asks for a data set. If the
[quoted text clipped - 15 lines]
 
K

kylesalone

each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....

kingston via AccessMonster.com said:
Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
salesman always use the same office? Is there a search required to find an
available office? No matter what the logic is, you'll probably need to use
the combo box's AfterUpdate event to populate the text box once a selection
is made. Does this make sense?
I have two different tables. Because I run a querry with each field in two
seperate querries. One table for salesman was created so I could make a combo
box for it. I have since created another table for the office field so I can
make a combo box for that if it will make this easier... IDK if it will or
not. I am just trying to cut down on user data entry errors. So, what I am
trying to accomplish is... when I select a <salesman> from the combo box in a
form... that the <office> will auto fill with the appropriate data. Thanks
so much.
Kyle
What is the row source for the combo box? IOW, where do the selections come
from? When you build a combo box, the wizard asks for a data set. If the
[quoted text clipped - 15 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
columns. Open the properties window of the combobox (right click on it and
select Properties in form design mode). Under the Event tab, in the After
Update box, select [Event Procedure]. Click the ... button at the end of the
line, and enter the following code:

Me.TextBox = Me.ComboBox.Column(1)

Replace TextBox and ComboBox with the actual names of the control. A list
should automatically appear when you type "Me." Select the proper control
name from the list.
each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....
Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
[quoted text clipped - 18 lines]
 
K

kylesalone

Awesome thank you... Can I still run a querry listing all the data from a
specific office? and will it let me view from a form which office its in?

kingston via AccessMonster.com said:
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
columns. Open the properties window of the combobox (right click on it and
select Properties in form design mode). Under the Event tab, in the After
Update box, select [Event Procedure]. Click the ... button at the end of the
line, and enter the following code:

Me.TextBox = Me.ComboBox.Column(1)

Replace TextBox and ComboBox with the actual names of the control. A list
should automatically appear when you type "Me." Select the proper control
name from the list.
each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....
Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
[quoted text clipped - 18 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

This shouldn't break any functionality that you already have working. So if
you have a query listing data from a specific office, I don't see why you
couldn't still run it. I don't understand your last question. What is it
that you want to view? Creating this procedure should not prevent you from
designing and running queries to get the data you need.
Awesome thank you... Can I still run a querry listing all the data from a
specific office? and will it let me view from a form which office its in?
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
[quoted text clipped - 17 lines]
 
K

kylesalone

Your right thank you.

kingston via AccessMonster.com said:
This shouldn't break any functionality that you already have working. So if
you have a query listing data from a specific office, I don't see why you
couldn't still run it. I don't understand your last question. What is it
that you want to view? Creating this procedure should not prevent you from
designing and running queries to get the data you need.
Awesome thank you... Can I still run a querry listing all the data from a
specific office? and will it let me view from a form which office its in?
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
[quoted text clipped - 17 lines]
different data in each of them.
Thanks
 
K

kylesalone

Im very close and hate to be a pain.. My comboBox control name has an
automatic "LABLE" name after it and Column wont show up after it....
?

kingston via AccessMonster.com said:
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
columns. Open the properties window of the combobox (right click on it and
select Properties in form design mode). Under the Event tab, in the After
Update box, select [Event Procedure]. Click the ... button at the end of the
line, and enter the following code:

Me.TextBox = Me.ComboBox.Column(1)

Replace TextBox and ComboBox with the actual names of the control. A list
should automatically appear when you type "Me." Select the proper control
name from the list.
each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....
Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
[quoted text clipped - 18 lines]
different data in each of them.
Thanks
 
K

kylesalone

Sorry... I may have left out some critical info...
I have a table called "Customers" within that table I have a field named
<office>.
I have another table named "Salesreps"
I created the "Salesreps" table so I could create a ComboBox in the
"Customers" form to make it easier for Data entry... Now I am wanting to make
the <office> field auto fill with the appropriate data when the data entry
person selects the salesrep in the form.

kylesalone said:
Im very close and hate to be a pain.. My comboBox control name has an
automatic "LABLE" name after it and Column wont show up after it....
?

kingston via AccessMonster.com said:
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
columns. Open the properties window of the combobox (right click on it and
select Properties in form design mode). Under the Event tab, in the After
Update box, select [Event Procedure]. Click the ... button at the end of the
line, and enter the following code:

Me.TextBox = Me.ComboBox.Column(1)

Replace TextBox and ComboBox with the actual names of the control. A list
should automatically appear when you type "Me." Select the proper control
name from the list.
each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....

Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
[quoted text clipped - 18 lines]
different data in each of them.
Thanks
 
K

kylesalone

any help on the new info below


kylesalone said:
Sorry... I may have left out some critical info...
I have a table called "Customers" within that table I have a field named
<office>.
I have another table named "Salesreps"
I created the "Salesreps" table so I could create a ComboBox in the
"Customers" form to make it easier for Data entry... Now I am wanting to make
the <office> field auto fill with the appropriate data when the data entry
person selects the salesrep in the form.

kylesalone said:
Im very close and hate to be a pain.. My comboBox control name has an
automatic "LABLE" name after it and Column wont show up after it....
?

kingston via AccessMonster.com said:
OK, now start with one table that lists the salesperson and the corresponding
office. Use this as the combobox's dataset. I.E. create a combobox with two
columns. Open the properties window of the combobox (right click on it and
select Properties in form design mode). Under the Event tab, in the After
Update box, select [Event Procedure]. Click the ... button at the end of the
line, and enter the following code:

Me.TextBox = Me.ComboBox.Column(1)

Replace TextBox and ComboBox with the actual names of the control. A list
should automatically appear when you type "Me." Select the proper control
name from the list.

kylesalone wrote:
each salesman does always have the same office... and your afterupdate
comment makes perfect sense. I just dont know how to do it....

Yes, but you need to define "appropriate data." How will the program make
the correct selection? Is it based on alphabetical order? Does each
[quoted text clipped - 18 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

Sorry, I don't have e-mail notifications turned on. If you're ever left
hanging like that, just post a new thread. Anyway, it sounds like you can
follow my previous post to do what you want:

In the customer form, there will be a combobox for Salesman. Populate
Salesman with a query that returns the Office and whatever other information
you need. Do this by changing the RowSource of the combobox; click on the ...
button at the right of the line and modify the query to return the desired
fields. Use the combobox's AfterUpdate event to set the other fields that
you want to automatically fill in:

Me.Office = Me.cboSalesman.Column(1)
Me.Field = Me.cboSalesman.Column(2)
...

If you change the existing combobox, you will have to reformat it to let
Access know that it has more than one column. Do this in the combobox's
properties window in the Format tab. Otherwise, just build a new combobox
and include all of the information to begin with. HTH
any help on the new info below
Sorry... I may have left out some critical info...
I have a table called "Customers" within that table I have a field named
[quoted text clipped - 30 lines]
 
K

kylesalone

Wow.. it worked! thanks so much.
Only thing now is that once I select the combo box and the field for
<office> "autofills", the combo box doesn't keep the salesmans name in it's
datafield... (weird?)
What ive done it made an expression so that the old field of <salesman01>
"autofills" as well.. but it would be nice if the combo box would just keep
the salesrep in there... any ideas there....

kingston via AccessMonster.com said:
Sorry, I don't have e-mail notifications turned on. If you're ever left
hanging like that, just post a new thread. Anyway, it sounds like you can
follow my previous post to do what you want:

In the customer form, there will be a combobox for Salesman. Populate
Salesman with a query that returns the Office and whatever other information
you need. Do this by changing the RowSource of the combobox; click on the ...
button at the right of the line and modify the query to return the desired
fields. Use the combobox's AfterUpdate event to set the other fields that
you want to automatically fill in:

Me.Office = Me.cboSalesman.Column(1)
Me.Field = Me.cboSalesman.Column(2)
...

If you change the existing combobox, you will have to reformat it to let
Access know that it has more than one column. Do this in the combobox's
properties window in the Format tab. Otherwise, just build a new combobox
and include all of the information to begin with. HTH
any help on the new info below
Sorry... I may have left out some critical info...
I have a table called "Customers" within that table I have a field named
[quoted text clipped - 30 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

Check your code to make sure you're not resetting it to nothing by accident.
Is the combobox bound to a field? Check the combobox's format and data
preferences. Now that you have a multi-column combobox, verify that the
bound column is the one that you want stored and that the column widths are
not 0" for example.
Wow.. it worked! thanks so much.
Only thing now is that once I select the combo box and the field for
<office> "autofills", the combo box doesn't keep the salesmans name in it's
datafield... (weird?)
What ive done it made an expression so that the old field of <salesman01>
"autofills" as well.. but it would be nice if the combo box would just keep
the salesrep in there... any ideas there....
Sorry, I don't have e-mail notifications turned on. If you're ever left
hanging like that, just post a new thread. Anyway, it sounds like you can
[quoted text clipped - 23 lines]
 
K

kylesalone

Thanks.. maybe I should have been clearer... The combo box shows the names of
the salesmen... it just doesn't stay there... i.e. once I tab to the next
record and put the appropriate salesman name in that record, it would change
the name of the salesrep in all the other records to the "last entered
salesrep" in the combo box...

kingston via AccessMonster.com said:
Check your code to make sure you're not resetting it to nothing by accident.
Is the combobox bound to a field? Check the combobox's format and data
preferences. Now that you have a multi-column combobox, verify that the
bound column is the one that you want stored and that the column widths are
not 0" for example.
Wow.. it worked! thanks so much.
Only thing now is that once I select the combo box and the field for
<office> "autofills", the combo box doesn't keep the salesmans name in it's
datafield... (weird?)
What ive done it made an expression so that the old field of <salesman01>
"autofills" as well.. but it would be nice if the combo box would just keep
the salesrep in there... any ideas there....
Sorry, I don't have e-mail notifications turned on. If you're ever left
hanging like that, just post a new thread. Anyway, it sounds like you can
[quoted text clipped - 23 lines]
different data in each of them.
Thanks
 
K

kingston via AccessMonster.com

Is the combobox a bound control? If it is unbound, it will display the same
value for all records. This goes for all the other controls too.
Thanks.. maybe I should have been clearer... The combo box shows the names of
the salesmen... it just doesn't stay there... i.e. once I tab to the next
record and put the appropriate salesman name in that record, it would change
the name of the salesrep in all the other records to the "last entered
salesrep" in the combo box...
Check your code to make sure you're not resetting it to nothing by accident.
Is the combobox bound to a field? Check the combobox's format and data
[quoted text clipped - 15 lines]
 
K

kylesalone

Thanks in advance... How do I make it bound?

kingston via AccessMonster.com said:
Is the combobox a bound control? If it is unbound, it will display the same
value for all records. This goes for all the other controls too.
Thanks.. maybe I should have been clearer... The combo box shows the names of
the salesmen... it just doesn't stay there... i.e. once I tab to the next
record and put the appropriate salesman name in that record, it would change
the name of the salesrep in all the other records to the "last entered
salesrep" in the combo box...
Check your code to make sure you're not resetting it to nothing by accident.
Is the combobox bound to a field? Check the combobox's format and data
[quoted text clipped - 15 lines]
different data in each of them.
Thanks
 
Top