Make a unbound field = 1

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,678
Code:
Private Sub Command11_Click()
On Error GoTo Command11_Click_Err

     updateQuery1
    DoCmd.OpenForm "frm_NIS_TSL", acNormal, "", "", , acNormal
        [TextSql].Value = 1

Command11_Click_Exit:
    Exit Sub

Command11_Click_Err:
    MsgBox Error$
    Resume Command11_Click_Exit

End Sub
How do I get TextSql to equal 1 in this event? Its an unbound text field
 

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,678
I get a message "Application-defined or Object-defined error

Code:
Private Sub Command11_Click()
'Go to TSL Button
On Error GoTo Command11_Click_Err

     updateQuery1
    DoCmd.OpenForm "frm_NIS_TSL", acNormal, "", "", , acNormal
    Forms!frm_NIS_TSL.TextSq = 1


Command11_Click_Exit:
    Exit Sub

Command11_Click_Err:
    MsgBox Error$
    Resume Command11_Click_Exit

End Sub
 

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,678
Got it!

It was missing an "l"

Forms!frm_NIS_TSL.TextSq = 1

Forms!frm_NIS_TSL.TextSql = 1

Thank You!
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
1,742
Yup, I made boo boo in 2nd example, which was intended for where value would be text.
You're welcome.
 

Forum statistics

Threads
1,077,722
Messages
5,335,832
Members
399,051
Latest member
WPO

Some videos you may like

This Week's Hot Topics

Top