borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Runtime error in VBA)Next Topic (Internet Explorer Download Automation) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Value of Subform Txtbox Solved Topic
Poster Message
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 20

icon Value of Subform Txtbox

I want to run a procedure based on the value of a textbox on my subform. The textbox will contain either a 1 or 0

Using Access

Formname = F_ShipTicketdata
Subform name = F_Pickticket
Textboxname = txtptcheck

this is where I get the error
If [Forms]![F_Pickticket]![txtptcheck].value = 0 Then

How should this be written?
Thanks

[Edited by gosamerone on 26-10-2006 at 09:03 AM GMT]

26-10-2006 at 02:01 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Value of Subform Txtbox

Hi,
I believe the syntax is
[Forms]!F_PickTicket]![subformnamecontrolname].Form.txtptcheck.value

Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

27-10-2006 at 09:55 AM
View Profile Send Email to User Show All Posts | Quote Reply
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 20
icon Re: Value of Subform Txtbox

I'm sorry, I have been trying this and I am still doing something wrong.  What goes in [subformnamecontrolname] because F_Pickticket does not work.
I have tried variations for the following

If [Forms]![F_ShipTicketdata]![F_Pickticket].Form.txtptcheck.value > 0 Then

I realize [F_Pickticket] is not right but txtptcheck is the txt box on my subform named F_Pickticket that I want to check against.

Sorry again for my confusion.

[Edited by gosamerone on 27-10-2006 at 08:14 AM GMT]

27-10-2006 at 01:13 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Value of Subform Txtbox

Hi,

Syntax is:


[Forms]![main_form_name]![subform_control_name].[Form]![field]


In your case...

You have a master form called something (main_form_name - "f_shipticketdata"), on this form is a subform.
Open the master form in design mode
Right-click on the child form (subform) and view the properties
the property "name" is what you put in subform_control_name

Hope that's clearer

Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

27-10-2006 at 03:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 20
icon Re: Value of Subform Txtbox

Sad thing was my subform property "name" was F_Pickticket

Followed everything but still had a problem. HOWEVER, I took out the last ".form" and it worked great

If Forms!F_ShipTicketdata!F_Pickticket!txtptcheck.value > 0 Then

Thank you so much for all your help!!!

27-10-2006 at 03:30 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Value of Subform Txtbox Solved Topic
Previous Topic (Runtime error in VBA)Next Topic (Internet Explorer Download Automation) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder