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

Connecting records in different entities

Status
Not open for further replies.

MikeRBS

IS-IT--Management
Apr 15, 2004
81
GB
I have a table of servers and a table of applications. I might want to record that 7 applications run on 4 servers. I don't want to manually enter 28 rows in the AppServer intersection table. I'd like to select the 7 and the 4, and have the 28 generated.

Last time I did this by writing a bit of ad-hoc SQL to load x rows (the 7 in the example) and ran it 4 times. I need a more elegant solution.

My first thought was to create two views with checkboxes, so the user could select the apps and servers. Then it would be a simple join to generate the required rows. But maybe there are better ways. What have you tried?
 
How about two list boxes that are both set up as 'Multi-Select'

Then a Go button which does a
For Each Selected In ServerList
For Each Selected In AppList
If Not LinkExists
DoCmd.RunSQL "Insert Into etc. to CreateLink
End If
Next
Next



'ope-that-'elps.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Multi-select sounds interesting! Presumably I need VBA to access the multiple values?
 
Yes - the basic structure of the VBA is what I've put in the earlier post.


If you've not come across MultiSelect option for list boxes before that is a very good explanation in the MS help file.

Create a dummy form and drag on a ListBox.
In the Multiselect property press F1 and review the diferences between Simple and Extended.

Click on the "Selected" hyperlink and then follow the "Example" link



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top