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

Making fields visible after inputting data

Status
Not open for further replies.

diggerbob

Technical User
May 20, 2004
24
US
I have a form that I am creating where in the first field I input dollar value and the second field I input quantity. A third text box is used as a calculated field based on the first field times the second field.
I have multiple sets of these fields on my form and all are invisible except the first set.
What I would like to be able to do is once I have inputted data in field one and field two and it populates into my calculated field, I would like the next group of the same three fields to appear and so on.
I want to do this so that the form is not cluttered up with a lot of text boxes. Can anyone help on this one?

Thanks
 
You can make them visible using the afterupdate for field2.

ex: Me.field2.Visible = True

May I ask however, regarding your underlying data, how the table is holding this information? For example, do you have multiple field1's and field2's (dollarvalue1, quantity1, dollarvalue2, quantity2, etc) in each row of the table?

Let them hate - so long as they fear... Lucius Accius
 
digger- You don't have fields on a form. A table has fields. A form has controls, sounds like the type of controls you are using are textboxes.
In the after update of the textbox control you could use me.textboxB.visible=True. With me is the form, textboxB is the one you want to see.
 
I would write a little VBA in the AfterUpdate event of the controls in question.

In the AfterUpdate even in field1 and field2 you could use something like
Code:
if ( (Me.field1.value is not null) and (Me.field2.value is not null) ) then
Me.field3.visible = true
end if

and also don't forget to write some code in the form's onload event to make those controls invisible each time to begin with.

Code:
Me.field3.visible = false
Me.field6.visible = false
etc...

One last thing: Sometimes I wonder; "Is that someone's signature? Or do they type that at the end of each post?
 
Thanks a bunch! We will try this tomorrow and hopefully this will solve our problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top