Advertisement

08.05.2008 at 11:47AM PDT, ID: 23623354
[x]
Attachment Details

Reference textbox from modules in Access (error 424) . . .

Asked by mike2401 in Access Coding/Macros, Visual Basic Programming, Access Forms

Tags: Microsoft, Access, 2003

This is driving me nuts.

I have an access database, with a form called frmStatus.
The form has txtStatus and lblStatus
I have a module which wants to change the value of the textbox or label on the form (I don't care which)

I keep getting a runtime error '424' (object required).
The:
DoCmd.OpenForm ("frmstatus")

works because it indeed opens the form.

It appears that the form name is recognized because when I type it in lower case, it changes the S to upper case, but none of these commands seem to work (all generate that error):

Option Compare Database
Public Sub main()
DoCmd.OpenForm ("frmstatus")
Set frmstatus.txtStatus.Text = "mike"
frmstatus!txtStatus.Value = "mike"
Set frmstatus.txtStatus.Value = "mike"
frmstatus.lblstatus.Value = "mike"
frmstatus.lblstatus.Text = "mike"
frmstatus!txtStatus.Text = 1

I must be missing something fairly fundamental,

Any tips would be greatly appreciated.

Thanks,
MikeStart Free Trial
[+][-]08.05.2008 at 11:50AM PDT, ID: 22163833

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Visual Basic Programming, Access Forms
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: wiswalld
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.05.2008 at 11:52AM PDT, ID: 22163848

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 11:54AM PDT, ID: 22163865

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628