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

Second set of input row should appear only when necessary 2

Status
Not open for further replies.

PPJOSEPH

IS-IT--Management
Apr 2, 2003
82
0
0
US
Hi,
I have a data entry form with five fields (name, address, city, county, state). 90% of the users will have only one record to enter but the other 10% might have more than one. So I created a second set of fields in the table (name1, address1, city1, county1, state1). Now in the data entry form I want the second row of record to appear only when necessary....hidden until the user click a command button. Is there a way to do it and if so can you help with it.
Any help is appreciated, thanks in advance
Paul
 
How are ya PPJOSEPH . . .

The problem is how to determine when the second row is required! What's the [blue]criteria[/blue] here?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Well, Aceman1....you lost me...sorry
Paul
 
Hi PPJOSEPH,
If you want to use a button_click to show your next record, ic name1, address1, city1, county1, state1 (which is not a very good database design), you could first hide all these fields on your form, and when the user clicks the button, you would set some vba code behind this button, like:

Me.name1.visible = true
Me.address1.visible = true
and so on...

A better idea would be to just take the user on a button click to a real next record (the second row in your datatable), with code like:

DoCmd.GoToRecord , , acNewRec

Pampers [afro]
Keeping it simple can be complicated
 
PPJOSEPH . . .

I was looking for a way to automate making the 2nd address visible. That question is now academic. I purpose the following:

[ol][li]Show all the fields for address1 and the name field for address2.[/li]
[li]If the user enters data in the name field for address2, [blue]the rest of the fields for address2 becomes visible[/blue], hidden if the field is empty.[/li][/ol]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks Pampers for the coding and the idea.
Thanks AceMan1 for your participation and willingness to help out.
You both deserves a star

With Pampers idea this is what I did:

When the user tabs on the last field in the first row, a command button is visible asking to click the button if another row is necessary, upon clicking the second row appears. Also as soon as the user enter info in the first field of the second row, the command button goes back to the invisible mode.
Thanks to you both.
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top