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

Function ran text box sort order fix.

Status
Not open for further replies.

swpsoak

Technical User
Mar 5, 2002
15
US
I use a form to run a number of reports (Access 97).
Some reports are mailing labels using queried information.
I have one button that runs a custom mailing label with prompted input information from functions that are stored in text boxes. This allows the user to create a custom mailing label for data that is not in the database.

The report has seven (7) text boxes, each calling a function from Modules. Each text box has a unique name and are NOT visible and are arranged in this order in the upper left-hand corner of the report.
The Control Source for each text box is as follows:

=GetFirstName named txtboxFirstname
=GetLastName named txtboxLastname
=GetAddr1 named txtboxAdd1
=GetAdd2 named txtboxAdd2
=GetCity named txtboxCity
=GetState named txtboxState
=GetZip named txtboxZip

The actual label displays four (4) text boxes that uses the data from the seven, non-visible, text boxes.
The Unbound text box Control Source for each is as follows:

=[txtboxFirstname] & “ “ &[txtboxLastname]
=[txtboxAdd1]
=[txtboxAdd2] this text box properties are set to Grow=Yes, Shrink=Yes, and Height=0” so that if there is no second address, it will shrink to nothing, otherwise it displays the data.
=[txtboxCity] & ”, “ & [txtboxState] & “ “ & [txtboxZip]

When the report is ran, data is prompted for by the functions, one at a time, with an input box; and the data is displayed correctly on the label and the label is printed; everything is correct…. BUT

Now the problem.
The functions are called out of order. Even though the Get function text boxes are in order in the upper left, the functions are prompted by City, State, Zip, Addr1, Addr2, Firstname and Lastname.
This is a real inconvenience.
There are no tab orders of course for the text boxes so how can I get the functions to run in the correct order of names, addresses, city, state, then zip.

Two of us have been working on this but alas...
Any help?

“Just trying to keep it simple.”

PS: For those interested in the function coding in the Modules. Each text box has a function of the following format. This one is named Get Firstname module.

Global FirstName As String

Public Function GetFirstName()
FirstName = InputBox("Enter First Name", "First Name")
GetFirstName = FirstName
End Function

PSPS: Thanks scriverb for your relies. :>) They sure help.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top