Problem with launching form from subform

JimJones

Registered User.
Local time
Today, 11:43
Joined
May 6, 2003
Messages
78
Hi,

I have a problem when I click on a command button on my subform named "mysubform", it gives me an error that it cant find the name of "mysubform".

The error:
Run-time error '2450'

"MyDatabase can't find the form "mysubform" referred to
in a macro expression or Visual Basic code."

Then, when I click on Debug, it points to this code:

Private Sub Form_Load()
UniqueCarID = Forms("CustomerCarData").UniqueCarID
End Sub

One thing I'll point out is that there appears to be one file name
UniqueCarID. But those are two different fields.

I even changed the name but it still gives the same exact error.

Also, the first one should be spelled UniqueCarId, but when I try to change it to the proper spelling, VB insists
on changing it back to ID (in caps).

Can you help?
Thanks,
Jim
 
That is not how you reference a text box in another form. Try...

Forms![frmCustomerCarData]![txtUniqueCarID]

Assuming txtUniqueCarID is the name of the text box, not the name of the table field.

You should learn how to use proper naming conventions for your db objects.

HTH
 
GHUDSON,

I was able to get it to open without errors, but my new 'problem'
is that the "UniqueCarID" number does not get reflected into the new pop up form field".

While creating the button, I was under the impression it would do this for me.

As far as proper naming conventions, please point me to a good,
comprehensive tutorial for doing so, as I know that is one of my hardest challenges (right now).

Thanks,
Jim
 
GHudson,

No, now it's telling me that it can't find the parent form, when I try the syntax you provided.

You told me to try:

Forms![frmCustomerCarData]![txtUniqueCarID]

(actually I have it
Forms![CustomerCarData]![UniqueCarID] )

And then when i click on the button on the subform, to open the popup form, it tells me that it can't find CustomerCarData.

the popup form name is tblCustomerCarNotes

Please Help?

Thanks,
Jim
 
Thanks so much !

That part of my problem works now !
Ineed I was using the name of the table field, and corrected it
to find that it now works.

Thanks,
Jim
 
Ghudson,

Yes, I've visited this site before.

Not only that, but I have downloaded the the Access Web 2000.
I opened it and did some looking around, but don't remember getting help for what I needed at the time.

I'll give it another, closer look.

I want to ask you though, about my project, do you think it's wise to go through the whole thing, and apply the "frm" and "tbl" to precede my form and table names ?

Is there a utility or 'wildcard' way to do that, so I don't risk breaking links to references and such ?

Thanks,
Jim
 
I want to ask you though, about my project, do you think it's wise to go through the whole thing, and apply the "frm" and "tbl" to precede my form and table names ?
YES, you should ensure that proper naming conventions are used for all of your db objects. Once you start using them from the beginning, it will not be an issue as you develope your dbs. It will make your job a lot easier when using VBA and it will also help anybody else who has to use/modify your db [as a programmer].

Speed Ferret is a program will do what you want. It is not free. I have never used it but I have heard good things about it.
http://www.moshannon.com/speedferret.html

HTH
 

Users who are viewing this thread

Back
Top Bottom