Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Please consider donating $1 per sample downloaded, find out why here. If downloading multiple samples, please donate once for all of them.
Amazon Honor System  Click Here
to Pay Learn More
Access 97, 2000, 2002 (XP) (Forum Locked Forum Locked)
 RAL Forums : Access 97, 2000, 2002 (XP)
Subject Topic: Newbie VBA help for form Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Tinku
Newbie
Newbie
Avatar

Joined: 20 October 2004
Location: Canada
Posts: 1
Posted: 20 October 2004 at 5:22pm | IP Logged Quote Tinku

I have 2 forms. 1st form is a lookup form. It has one combo-box. Based on the selection of the combobox I want to display only one field from a table which has 16 fields. I donot want to create 16 forms for each selection. Is there a way I can just create one form and depending on the selection of the combo box I can assign that to that one form.

If I am not making sense please let me know.

Regards

Tinku

Back to Top View Tinku's Profile Search for other posts by Tinku Send Private Message Add to Buddy List
 
wizcow
Newbie
Newbie


Joined: 03 May 2003
Location: Canada
Posts: 38
Posted: 28 October 2004 at 8:08pm | IP Logged Quote wizcow

Tinku

You could use an if statement in the after update of your combo box.

example...

Private Sub YourComboBox_AfterUpdate()

If YourComboBox = 1 then
Forms!Form2!YourTextBox.ControlSource = Field1
Else If YourComboBox = 2 then
Forms!Form2!YourTextBox.ControlSource = Field2
EndIf

End Sub

This If statement uses the result from YourComboBox to decide what to use as the Control Source for the text box on form 2.

You could also use a Case statement. Look that up in Help.

HTH
Tom
Back to Top View wizcow's Profile Search for other posts by wizcow Visit wizcow's Homepage Send Private Message Add to Buddy List
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.01
Copyright ©2001-2003 Web Wiz Guide