Make a unbound field = 1

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,682
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,682
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,682
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,758
Yup, I made boo boo in 2nd example, which was intended for where value would be text.
You're welcome.
 

Forum statistics

Threads
1,081,530
Messages
5,359,347
Members
400,524
Latest member
Excelbat

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top