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

combo box not changing form fields

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
In Access 2007:
DoCmd.SearchForRecord , "", acFirst, "[Customer] = " & "'" & Screen.ActiveControl & "'"

Is this not supposed to select the record on my form? I had it working, and didn't change a thing.

User opens form and selects a Customer. It fills in Customer name, currency and a few other fields. The form is bound to a table with those fields. I used a wizard to create the combo box (find a record on the form based on selection), pretty straight forward.

But, when the user selects a different Customer, the fields do not change? What the heck?

I also have two subforms, and they change based on the new selection.

I am also trying to get a Save/New button to work. I have a Save/Close button working but can't seem to get the form to clear after saving. I know I have done this before on other projects in Access 2000, but can't seem to find what I need.

Any help is appreciated.
 
Wait... I think I know. I want my form to retrieve a record only if it's there. Otherwise, the user needs to fill in the boxes.

Do I need to double up all my fields and dispaly them based on whether it is a new record or not? Or can I accomplish this with VBA code (I would need help with that).

thanks
 
To clear the form Me.YourControlNameHere.Value = "" .... for each control on the form AFTER you save it

MaZeWorX

Remember amateurs built the ark - professionals built the Titanic

[flush]
 
That wasn't working because it's too obvious a solution.

I created a separate form for new records.

My record source was messing up the other form. I have a new problem and I'll start a new thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top