Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling bound textbox on bound form 2

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
Had this problem before, worked round it but now another issue.

Private Sub Command244_Click()
Me.Dummy2.SetFocus
Me.LB.SetFocus
Me.LB = SECNAME
End Sub

I have tried moving focus to a dummy field as last resort but still told Access canot move to LB

Any ideas, thanks
 
I assume SECNAME is the text value you want Me.LB to have

If so the put it in inverted commas
Me.LB = "SECNAME"


hope this helps
Jimmy


 
Thanks, but SECNAME is a variable.
 
If you are just trying to assign the value of SECNAME to the textbox when you click on the commandbutton, you should not even need the focus calls.

Code:
Private Sub Command244_Click()
Me.LB = SECNAME
End Sub

If you want the cursor in the textbox after you set the value, then you would probably want the focus call AFTER you set the value in the textbox.

Code:
Private Sub Command244_Click()
Me.LB = SECNAME
Me.LB.SetFocus
End Sub

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Thanks guys. I thought I was doing it properly but you both confirmed it. Someone had put code in to make the field hidden on load. As its background was set to transparent I did not notice it. I'd only checked it was enabled and unlocked. Too many cooks. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top