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

User Input using Multiple Forms

Status
Not open for further replies.

naiku

Technical User
Apr 25, 2002
346
US
Hello, I need some help with creating a user input based on several forms (I think). What I want is for the user to enter each section of information, and then to at the end hit enter and be shown a print preview of the completed data ready for printing.

Say I have 3 sections of data:
1) Customer
2) Products
3) Details

I think that the simplest way would be to on the After_Update event of the last field on each form have some code that will then automatically open the next form:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "data_entry_form"
DoCmd.OpenForm stDocName, , , stLinkCriteria

And to then add code to the OnLoad event of the next form to close the previous form.

The only other way I can think of is to use a command button to open the next form, but this sounds like a less efficient way of doing things. I think I may have answered my question by using the After_Update event above, but would be interested if there is any better way of achieving the same thing. Thanks.
 
Few thoughts
[ul]
[li] A master form & several forms set in a TabControl is more efficient. [/li]
[li] AfterUpdate Event should validate the fields then go to the next form. better to use command buttons. [/li]
[li] For printing use a report not a form [/li]
[/ul]

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
How are ya naiku . . . . .

Also consider, there are cases where its best to prompt the user somehow for [blue]a positive indication of when there done[/blue]. When most users see a command button that saids [purple]Click Here To Continue[/purple], they at least have every [blue]tendency to give the form another visual check![/blue]

Full automation [purple]doesn't allow for this double checking![/purple] Nor does it allow for say . . . [purple]typos![/purple]

Either way, its your call . . . .

Also, [blue]code in the calling form can close the form its in.[/blue] You dont have to close it from the dependent form . . .

Calvin.gif
See Ya! . . . . . .
 
Shouldn't automation also detect for erroneous data entered and give the user the chance to fix errors before moving on?? Preferably when the user moves from one field to the next...
 
How are ya paulrw1 . . . . .

In an over-all general senese . . . yes. Its called validation.

[blue]And if you misspell your name or address or some other?[/blue]

This is the basis of a great many menu driven programs.

[purple]How many forms have you filled out on line that automatically went to the next page without hitting a button?[/purple]

Calvin.gif
See Ya! . . . . . .
 
TheAceMan1:
I'm doing ok, I think. Is it Friday yet??? lol.. Actually Friday promises to be a long day, as i have a vendor coming in to try a procedure to do a mass import of stored documents..

How many forms move on w/o hitting a button?? Hmm off the top of my head I can't think of too many.. But then again those forms sometimes don't do validation until the end.. Which is a pain in the you-know-what.

I always perform validation in the programs I write. I need to make sure data entered by a user is correct and accurate before the report (a barcode sheet) gets printed.
 
Thank's for the replies all. I had a think about this last night and decided that a command button is a better way of doing this.

I had made a basic view of the form and realized that the last field may not always be changed, if my code above was the only way of opening the new form then things would not progress too far.

Also from replies given above if I use a command button, I am then able to have a msgbox appear asking the user to check data before moving on. Thanks again all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top