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!

All records change when I apply a conditional 1

Status
Not open for further replies.

mrgrogro

Technical User
Jan 8, 2005
58
0
0
US
I am creating an Access 2000 database for my wife's very small business. I have created a form for her to log her expenses. There is a combo box with common expense types called "TypeOfExpense". I wrote this simple code so that, for example, if "Parking" were selected from the list a text box called "Origin" would no longer be visible as it would not be applicable to a parking expense. Here's the code:

Private Sub TypeOfExpense_Change()
If Me.TypeOfExpense.Value = "Parking" Then
Me.Origin.Visible = False
Else
Me.Origin.Visible = True

End If
End Sub

The code works too well. All the "Origin" fields disappear on each record throughout my continuous form. How can I make the conditional apply to only the current record? Any help would be greatly appreciated and surely earn a star.

Thanks in advance.

kp
 
Thanks so much. Your star is almost within grasp. I'm not sure how to proceed since it's the input into one field that is to change the view of another. Will this work if I change to a single form view? Do I have to something with the "on Current" setting of the actual form? Any more help you can provide will be greatly appreciated. You'll get your star regardless. Thanks so much!

kp

ps

I'm going to read everything I can on this website. It looks to have great potential for an amateur such as myself.
 
If you switch to a single form view your original solution would work as long as you put similar code in the forms on current.
For conditional formatting you should not need to do anything except on the typeOfExpense change event you might need a "me.refresh".
 
Thanks MajP! I have to try it after dinner but am eternally grateful for your help! Enjoy the star! You earned it.

kp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top