Combo Box data

O

Oli

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0
 
G

Guest

I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



Ofer said:
For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


Oli said:
Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



Aaron said:
I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



Ofer said:
For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


Oli said:
Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

I put that in the after update event field, however now after choosing the
city I get the error:

NameofDatabase can't find the macro 'me'.

Does this expression need to be included in a full VBA expression?

Thank you for the quick response.




Ofer said:
On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



Aaron said:
I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



Ofer said:
For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


:

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

What is the statement you wrote?
Whet is the name of the State Combo field in the form?
Are the combo boxes under a subform or a form?
If the fields are under a subform, then what is the name of the subform in
the main form?


Aaron said:
I put that in the after update event field, however now after choosing the
city I get the error:

NameofDatabase can't find the macro 'me'.

Does this expression need to be included in a full VBA expression?

Thank you for the quick response.




Ofer said:
On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



Aaron said:
I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



:

For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


:

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

I put: me.[ORIG STATE BOX].requery in the "AfterUpdate" box.
Field name is: "ORIG STATE BOX"
They are under a form.

The essence of the form allows the user to pick an origin and a destination
and it pulls from one table and shows all of the records with the criteria
chosen.





Ofer said:
What is the statement you wrote?
Whet is the name of the State Combo field in the form?
Are the combo boxes under a subform or a form?
If the fields are under a subform, then what is the name of the subform in
the main form?


Aaron said:
I put that in the after update event field, however now after choosing the
city I get the error:

NameofDatabase can't find the macro 'me'.

Does this expression need to be included in a full VBA expression?

Thank you for the quick response.




Ofer said:
On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



:

I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



:

For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


:

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
G

Guest

Nevermind, found another post that helped me out. It was basically the same
thing, just had some syntax issues.
Thanks though.



Aaron said:
I put: me.[ORIG STATE BOX].requery in the "AfterUpdate" box.
Field name is: "ORIG STATE BOX"
They are under a form.

The essence of the form allows the user to pick an origin and a destination
and it pulls from one table and shows all of the records with the criteria
chosen.





Ofer said:
What is the statement you wrote?
Whet is the name of the State Combo field in the form?
Are the combo boxes under a subform or a form?
If the fields are under a subform, then what is the name of the subform in
the main form?


Aaron said:
I put that in the after update event field, however now after choosing the
city I get the error:

NameofDatabase can't find the macro 'me'.

Does this expression need to be included in a full VBA expression?

Thank you for the quick response.




:

On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



:

I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



:

For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


:

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 
Á

áÌÅËÓÅÊ ëÁÌØÎÉÃËÉÊ

Aaron said:
Nevermind, found another post that helped me out. It was basically the same
thing, just had some syntax issues.
Thanks though.



Aaron said:
I put: me.[ORIG STATE BOX].requery in the "AfterUpdate" box.
Field name is: "ORIG STATE BOX"
They are under a form.

The essence of the form allows the user to pick an origin and a destination
and it pulls from one table and shows all of the records with the criteria
chosen.





Ofer said:
What is the statement you wrote?
Whet is the name of the State Combo field in the form?
Are the combo boxes under a subform or a form?
If the fields are under a subform, then what is the name of the subform in
the main form?


:

I put that in the after update event field, however now after choosing the
city I get the error:

NameofDatabase can't find the macro 'me'.

Does this expression need to be included in a full VBA expression?

Thank you for the quick response.




:

On the after update event of the field city write
me.[StateCombo].requery

To refresh the combo with the new selection



:

I have a similar situation. On the same form, there are combo boxes, two
being city and state. when a city is selected, I want only the states
associated with that city to be shown on the rowsource for the combo box.
Here is my SQL for the Rowsource for the State control:


SELECT [LINE HAUL 2005].[Origin Ramp State]
FROM [LINE HAUL 2005]
WHERE ((([LINE HAUL 2005].[Origin Ramp City])=[Forms]![LINK UP FORM]![ORIG
CITY BOX]));

It works when I do it the first time, for example I select Atlanta, and only
GA is shown as choices in the box.
However if I then select a different city, say Los Angeles, GA is still the
only one showing. It seems as if the rowsource query does not update. However
I tried running a macro that would update the query after a change in the
City control box, and it did the same thing.

Any help would be appreciated.

Thanks



:

For the first question
If form2 is open only from form1 then you can enter in the RowSource
Property of the combo
Select Field1,Field2,Field3 From MyTable Where clients =
Forms![Form1Name]![clientsFieldNameInForm1]
====================================================
Second question
On the after update event of the combo write the code

Me.anothertextboxName = Me.ComboName.Column(0) ' Depend on the location of
the field you want to pass, starting with 0


:

Hi,

I have a form (form1) with a command button that opens another form (form2).

On form2 i have a combo box that displays telephone numbers of clients.

However, i only want the combo box to display the telephone numbers of the
client selected on form1 where i pressed the command button.

How can i do this?

Also, when a telephone number is selected from the combo box, i want another
textbox on the form to be automatically filled with some data in the same
row of the table. Any ideas?

Many thanks in advance
Oli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top