form can not be found!

J

jack

I have one database which includes tables and a few forms A,B,C. In m
code for form B, I coded:
Set rst = Forms!A.RecordsetClone

and I got error that A can not be found. can someone tell me how t
solve this problem? Thanks
 
K

Kelvin

Forms can only be referred to when they are open. If form A isn't open then
you cannot do anything to it. What are you trying to accomplish?

Kelvin
 
J

jack

thanks! Kevin:
I just want to use some data in the table A which the form A links to
so how can I refer to the data in table A?

by the way, when I click a combobox and get the pull down list, what'
the event? click or getFocus?

Jac
 
K

Kelvin

Again, I need to know how you are going to use this data. You can't just
refer to the data in a table like you would if there was a form. When you
refer to a form, it refers to the current record that is shown on the form.
If you were to refer to a table, there is no current record so just saying
you want to refer to a table doe snot make sense. Are you trying to look up
a specific piece of information or are you using Table A to populate a combo
box?

When you pick something from a combo box it is the Update event. However,
there are 2 update events, BeforeUpdate and AfterUpdate. The BeforeUpdate
can be used to do data verification before the information is saved. The
AfterUpdate event is used to accomplish a task after the data is saved. The
OnClick event is not so clear for a combo box. Its better not to use this
event. The GotFocus event is triggered when this box becomes the active
box, either by clicking on it with the mouse, or tabbing to it with the
keyboard, setting the focus through code.

Kelvin
 
J

jack

one field in Table A is Name, in form B, I need to get all the names i
table A and do some string processing to each name, and then add thos
processed names to the combobox in form B.

Thanks again
 
K

Kelvin

Do you mean you have a name like Bob W. Smith in Table A as 3 different
fields. Then on Form B you have a combo box that you want to populate with
Bob W. Smith as one field or something similar. If so, then for the combo
box set the record source type to table/query then in the record source
create a query based on Table A that will do the string processing. You
query will look something like the following.

Field1 Field2
NameID Name:[FirstName]&" "&[MiddleInitial]&". "&[LastName]

So if Table A looked like

NameID FirstName MiddleInitial LastName
1 Bob W Smith

The query will result in

NameID Name
1 Bob W. Smith

Then in the properties for the combo box set the bound column to 1, number
of columns to 2, and the column widths to 0,2. If you have a field in the
data that is linked to your form then set the control source to this field.
It should be the same data type as the NameID.

Kelvin
 

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