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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upon form open or load, clear bound textboxes

Status
Not open for further replies.

TriciaPreuss

Programmer
Mar 14, 2003
8
US
I have a form with textboxes bound to a query. My users can get to records using combo boxes. When the form opens, I want the bound textboxes to be empty. Now the first record in the query appears. Is there a way to show bound textboxes as empty until a value is selected from the combo box? I'm sure there is an easy answer, but I'm stumped! Thanks in advance.
 
In design view, set the form's record source to "" (empty).

On the combobox's Change() event, set Me.RecordSource = "SELECT * FROM tblTABLENAME WHERE ID = " & combo.Value

This isn't real code, because I don't know your specifics. You'd basically create an SQL statement and set the RecordSource to your SQL. --
Find common answers using Google Groups:

 
Hi,

You can also try this:

On your form's "On Open" event:

Me!Text1 = ""
Me!Text2 = ""
Etc.

On your combo box's "After Update" event:
(Change FormName to your form name, combobox to your combobox name)

Dim RecNum

WONum = Me!ComboBox
Requery
Forms!FormName.RecordsetClone.FindFirst "FormName.ComboBox = " & RecNum
Forms!FormName.Bookmark = Forms!FormName.RecordsetClone.Bookmark

HTH,

jbehrne
If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top