combox show record

D

Darius

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
K

Klatuu

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.
 
D

Darius

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.
 
K

Klatuu

Post the code, please, and I'll have a look.

Darius said:
comes up with an error saying the value entered is not valid for the field.
but the box is unbound.
 
D

Darius

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.
 
K

Klatuu

I meant your version of the code I posted.

Darius said:
there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.
 
K

Klatuu

Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

Darius said:
Me.Combo73=[Project_Name]

Klatuu said:
I meant your version of the code I posted.
 
D

Darius

You are right I do need to lable my items better. This is the first time
using access and i have learned alot. If i was to redue this project over i
would have went through and named everything better. When you asked what
code i had used i had already deleted it and typed it in from memory but i do
remember when i typed it in the first way it would not even compile. so i
then typed it in the way you just suggested below and that is when i got this
error that i was asking about.
You where right in that this is what i had acctually used.
Me.Combo73=Me.[Project_Name]

Klatuu said:
Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

Darius said:
Me.Combo73=[Project_Name]

Klatuu said:
I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
D

Darius

and i remember when i had found who to do this on that website it was a
couple of lines of code. DAMN ME FOR NOT BOOKMARKING IT

Klatuu said:
Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

Darius said:
Me.Combo73=[Project_Name]

Klatuu said:
I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
K

Klatuu

What is the row source for Combo73?
Is is a multi column combo?

Darius said:
You are right I do need to lable my items better. This is the first time
using access and i have learned alot. If i was to redue this project over i
would have went through and named everything better. When you asked what
code i had used i had already deleted it and typed it in from memory but i do
remember when i typed it in the first way it would not even compile. so i
then typed it in the way you just suggested below and that is when i got this
error that i was asking about.
You where right in that this is what i had acctually used.
Me.Combo73=Me.[Project_Name]

Klatuu said:
Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

Darius said:
Me.Combo73=[Project_Name]

:

I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
D

Darius

No just a single combo listing the Project Name that is it
and the the other combo box lists these project names and makes it so you
can go the record with that project name in the first combo box

Klatuu said:
What is the row source for Combo73?
Is is a multi column combo?

Darius said:
You are right I do need to lable my items better. This is the first time
using access and i have learned alot. If i was to redue this project over i
would have went through and named everything better. When you asked what
code i had used i had already deleted it and typed it in from memory but i do
remember when i typed it in the first way it would not even compile. so i
then typed it in the way you just suggested below and that is when i got this
error that i was asking about.
You where right in that this is what i had acctually used.
Me.Combo73=Me.[Project_Name]

Klatuu said:
Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

:

Me.Combo73=[Project_Name]

:

I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
K

Klatuu

Sorry, I am at a loss here. This is a technique I use in my forms. The
bound text box that has the value is hidden. I use the Current event to
display the text box value in the combo box.
Me.cboActivity = Me.txtActitity

Darius said:
No just a single combo listing the Project Name that is it
and the the other combo box lists these project names and makes it so you
can go the record with that project name in the first combo box

Klatuu said:
What is the row source for Combo73?
Is is a multi column combo?

Darius said:
You are right I do need to lable my items better. This is the first time
using access and i have learned alot. If i was to redue this project over i
would have went through and named everything better. When you asked what
code i had used i had already deleted it and typed it in from memory but i do
remember when i typed it in the first way it would not even compile. so i
then typed it in the way you just suggested below and that is when i got this
error that i was asking about.
You where right in that this is what i had acctually used.
Me.Combo73=Me.[Project_Name]

:

Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

:

Me.Combo73=[Project_Name]

:

I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
D

Darius

Yes what you are saying makes perfect sence to me.
and I just entered the code back in and it works untill you use the find
combobox
which in my case is combo74 then it starts coming up with this error saying
"The value you entered isn't valid for this field"
this is the code i used and put it in the form under On Current

Me.Combo74 = Me.Project_Name

Klatuu said:
Sorry, I am at a loss here. This is a technique I use in my forms. The
bound text box that has the value is hidden. I use the Current event to
display the text box value in the combo box.
Me.cboActivity = Me.txtActitity

Darius said:
No just a single combo listing the Project Name that is it
and the the other combo box lists these project names and makes it so you
can go the record with that project name in the first combo box

Klatuu said:
What is the row source for Combo73?
Is is a multi column combo?

:

You are right I do need to lable my items better. This is the first time
using access and i have learned alot. If i was to redue this project over i
would have went through and named everything better. When you asked what
code i had used i had already deleted it and typed it in from memory but i do
remember when i typed it in the first way it would not even compile. so i
then typed it in the way you just suggested below and that is when i got this
error that i was asking about.
You where right in that this is what i had acctually used.
Me.Combo73=Me.[Project_Name]

:

Is [Project_Name] a control on your form? You really should qualify your
objects, not only for those who read the code, but when you don't explicitly
name your objects (and it appears you don't if you have a control named
Combo73), Access will give the control the same name as the field it is bound
to. So when you reference it, it may get confused.
Try
Me.Combo73=Me.[Project_Name]

:

Me.Combo73=[Project_Name]

:

I meant your version of the code I posted.

:

there is no code for it yet i have two combo boxes on same form
one for project name(A) the other to find a project (B).
if you go to B and select on then it takes the form to the record where B = A
i just want to make it so if your using the record selector at the bottom or
scrolling throught the records A with obviously follow along because it is
bound to Project names. B is blank till someone wants to go to a specific
Project record which they use B to get to. If scrolling through the records
i would like B to fallow along. Which it did with the code you told be to
put in but that error message came up with every record change.


:

Post the code, please, and I'll have a look.

:

comes up with an error saying the value entered is not valid for the field.
but the box is unbound.

:

The code would not go in the combo box. It goes in the Current event of the
form.

Me.MyCombo = ????
Where ??? is the name of the control that has the value you want in the combo.

:

Hello
I have a combo box that has the form go to a related record.
Somewhere on the internet i found a couple lines of code to put in the combo
box area that makes it so the combo box displays what record you are on now.
So when i switch to another record that combo box displays that record.
Unfortunetly i did not bookmark the page where that code was.
Could someone please help.
Thank Darius
 
Top