Info in CBO not following records

S

Stockwell43

Hello,

I have a form with a text box to enter a project name. When the project name
is added, the user would click the Add Record button which also requeries the
form. Then when they click on the project list CBO, the project name previous
entered will show. This all works fine except, if the user uses the record
selector on the bottom of the form to scroll through the projects, the form
will show all the different project but the project list CBO stays on the
same project that was last viewed and I don't know how to get it to follow
the with each record. The Project list CBO is an unbound CBO with the
following in the Row source and not sure where the Expr1 is coming from but
it keeps entering that.

SELECT tblprojectinformation.ProjectID, [ProjectName] AS Expr1 FROM
tblprojectinformation ORDER BY [ProjectName];

Thanks!!
 
M

Maurice

If you want the cbo to 'actively' react to the current record you have to put
the following code in the 'On Current' event of the form:

me.cbo=me.projectid

where me.cbo should read the name of your combobox

Now when you use the recordselectors you will see that the cbo will change
accordingly.

hth
 
S

Stockwell43

Hi Maurice,

Thank you for your response, it works like a charm!!!! I couldn't figure
that out for the life of me but I saved it with the rest of my code.

Thank you again!!!

Maurice said:
If you want the cbo to 'actively' react to the current record you have to put
the following code in the 'On Current' event of the form:

me.cbo=me.projectid

where me.cbo should read the name of your combobox

Now when you use the recordselectors you will see that the cbo will change
accordingly.

hth

--
Maurice Ausum


Stockwell43 said:
Hello,

I have a form with a text box to enter a project name. When the project name
is added, the user would click the Add Record button which also requeries the
form. Then when they click on the project list CBO, the project name previous
entered will show. This all works fine except, if the user uses the record
selector on the bottom of the form to scroll through the projects, the form
will show all the different project but the project list CBO stays on the
same project that was last viewed and I don't know how to get it to follow
the with each record. The Project list CBO is an unbound CBO with the
following in the Row source and not sure where the Expr1 is coming from but
it keeps entering that.

SELECT tblprojectinformation.ProjectID, [ProjectName] AS Expr1 FROM
tblprojectinformation ORDER BY [ProjectName];

Thanks!!
 

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