A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multiple Table lookup



 
 
Thread Tools Display Modes
  #1  
Old July 23rd, 2008, 05:12 PM posted to microsoft.public.access.tablesdbdesign
Maria315
external usenet poster
 
Posts: 1
Default Multiple Table lookup

I have an database with weekly tables for contributions. I would like
to build a form that will allow users to select the table they want
from a drop down or parameter. I can work with Macros but not so good
with SQL. Is it possible to create a parameter query and link to the
form or a macro which would call for the table?
  #2  
Old July 23rd, 2008, 06:46 PM posted to microsoft.public.access.tablesdbdesign
Ryan
external usenet poster
 
Posts: 551
Default Multiple Table lookup

Make another table and put in it the names of your weeks. Then create a form
for each of your weak tables and use the same name you just put in your weeks
table. Next create a form for them to choose the week, add a dropdown to the
form, name it WeekFilter, and set its conotrol source to your new weeks
table. Add a comand button to your form and call it OpenWeek. In the on
click event of the command button add this code.

Private Sub OpenWeek_Click()
Dim WeekForm As String
WeekForm = Me!WeekFilter

DoCmd.OpenForm WeekForm
End Sub

This will take the value you selected in your dropdown and open the form
with that name.

Hope this helps.
--
Please remember to mark this post as answered if this solves your problem.


"Maria315" wrote:

I have an database with weekly tables for contributions. I would like
to build a form that will allow users to select the table they want
from a drop down or parameter. I can work with Macros but not so good
with SQL. Is it possible to create a parameter query and link to the
form or a macro which would call for the table?

  #3  
Old July 23rd, 2008, 06:55 PM posted to microsoft.public.access.tablesdbdesign
Steve[_57_]
external usenet poster
 
Posts: 598
Default Multiple Table lookup

You have encountered the problem that occurs when tables are not
normaslized. If possible you need to change the design of your tables to
something like:

TblContributionWeek
ContributionWeekID
ContributionWeek
Other contribution week fields you need

TblContribution
ContributionID
ContributionWeekID
Contribution
Other contribution fields you need

Changing the table structure is not as difficult as it may appear. You need
to use append queries and or update queries to move existing data into the
new tables. Then you need to modify any queries, forms and reports that use
your existing weekly tables.

Steve



"Maria315" wrote in message
...
I have an database with weekly tables for contributions. I would like
to build a form that will allow users to select the table they want
from a drop down or parameter. I can work with Macros but not so good
with SQL. Is it possible to create a parameter query and link to the
form or a macro which would call for the table?



  #4  
Old July 23rd, 2008, 09:06 PM posted to microsoft.public.access.tablesdbdesign
Klatuu
external usenet poster
 
Posts: 7,074
Default Multiple Table lookup

You first mistake is you are using a different table for each week. This
will actually make things much harder for you. The correct method would be
to have one table for all contributions with a field that identifies the week
and year of the contributions. In fact, if you already have a contribution
date in the table, that field will suffice.

Then when you need to see contributions for a specific week, you use a query
that is filtered on that week.

--
Dave Hargis, Microsoft Access MVP


"Maria315" wrote:

I have an database with weekly tables for contributions. I would like
to build a form that will allow users to select the table they want
from a drop down or parameter. I can work with Macros but not so good
with SQL. Is it possible to create a parameter query and link to the
form or a macro which would call for the table?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.