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

combo box on form1 to open form 2 with the values of txtboxes

Status
Not open for further replies.

vanlanjl

Programmer
Jan 14, 2009
93
US
Okay i have two forms.
Form1 = frmSearchUsers
Form2 = frmAssetTransferApproval.

Form 1 Text boxes:
File as
Contact Name
ID
Company
Last Name
First Name
Initial
E-mail Address
Job Title
Business Phone
Home Phone
Mobile Phone
Fax Number
Address
City
State Province
Zip
Country
User Name
Charge code
location code

Form 2 txtboxes:
Location code
Last Name
First name
Business phone
location code
I want to pull up a record in form1 then select a cmd button that will open form2 and automatically fill the txt boxes with the data that was in form 1.
Is this possible?Any help is appreciated, thanks.

 
Becuase i need to populate a template that my company uses and since no one answered my thread on how to export a form to a word doc i just created the form the way i wanted it to look and it works perfect, can even print it out
 
There are several reasons why you may not have got an answer, so I won't guess. There are also several ways to use Access with Word, mailmerge and bookmarks spring to mind.

Together we have gone through selecting a record on a form using a combobox, why not use the same thing here and have one form instead of two?

 
Should we assume both of the forms are based off of the same table (tbl_working in my case below)?



then on your command button use

strwhere = "((tbl_working.id) =" & id & ")
DoCmd.Close acForm, "frmSearchUsers"
DoCmd.OpenForm "frmAssetTransferApproval", , , strwhere
you may have to include ID in your frmassettransferapproval but just make it invisible

This also assumes ID is a primary key or at least a unique value

ck1999
 
How are ya vanlanjl . . .

Perhaps the following will do:

Code:
[blue]   Dim frm2 As Form, x As Integer, ctlName As String
   
   DoCmd.OpenForm "[purple][B][I]Form2Name[/I][/B][/purple]"
   DoEvents
   Set frm = Forms![purple][B][I]Form2Name[/I][/B][/purple]
   
   For x = 1 To 4
      ctlName = Choose(x, "Location Code", "Last Name", "First Name", "Business Phone")
      frm(ctlName) = Me(ctlName)
   Next
   
   Set frm = Nothing[/blue]


See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I am sorry, but I think that this can only lead to problems when the user makes some necessary change to the data that have been copied to an unbound form and the change does not happen in the main table - hopefully it is an unbound form in the example given or data will be duplicated as this form is really a report:
Because I need to populate a template that my company use
-- 26 Jan 09 15:20

From previous posts, I do not believe that vanlanjl is familiar with Access, yet.

 
Remou . . .

[blue]Roger That![/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Actually I figured it out and it works fine. But thanks to all those who have helped
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top