472,983 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 software developers and data experts.

Multiple link criteria and new records

I am working on a database to be used for auditing medical groups.
TABLE:DETAILS contains these fields:

[Review ID] (autonumber)
[Date]
[Auditor]
50 group fields [1] through [50] each a combo box that pulls from the
same list of 100+ groups

Each group is audited by reviewing 10-20 patient records. This
information is stored in TABLE:WS and contains the fields:

[ID] (autonumber)
[Review ID] links to TABLE:DETAILS (many-one)
[Group] contains value from one of the fields [1] through [50]
Other fields

The problem I am running into is that I can open the form where
[Review ID]=[Review ID] and [Group]=[1], etc. for each one, but it
will only show existing records, not add new records with both the
[Review ID] and [Group] assigned. Instead, I get a no related record
error message.

This is what I am using:
stLinkCriteria = "[Review ID]=" & Me![Review ID] & " And [Group]='" &
Me![1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The form has a subform and BOTH are from TABLE:WS using [Review ID]
and [Group] as link criteria.

I know it's awkward to have each group as a different item on the
Details table and then equal the same value in the WS table, but with
such a large number varying every month, I really couldn't see a
better way to do it.

I'm usually pretty good at reading existing answers, but this one has
me stumpted. Any suggestions?

Thanks! April (ap****@scanhealthplan.com)
Nov 12 '05 #1
1 4537
af******@yahoo.com (April) wrote in message news:<a4**************************@posting.google. com>...
I am working on a database to be used for auditing medical groups.
TABLE:DETAILS contains these fields:

[Review ID] (autonumber)
[Date]
[Auditor]
50 group fields [1] through [50] each a combo box that pulls from the
same list of 100+ groups

Each group is audited by reviewing 10-20 patient records. This
information is stored in TABLE:WS and contains the fields:

[ID] (autonumber)
[Review ID] links to TABLE:DETAILS (many-one)
[Group] contains value from one of the fields [1] through [50]
Other fields


I'm not saying this is the way you should do it, but consider the
following structure:

ReviewDetails Groups Reviews
ReviewDetailID (PK) GroupID (PK) ReviewID (PK)
ReviewID GroupName ReviewName
GroupID ReviewDate
OtherFields...

Note: Watch out for names like Group, Detail, Date because
Access uses those names for other things and can get confused.

Reviews acts similar to an Orders Table. ReviewDetails acts similar
to an OrderDetails Table with the exception that the OrderDetails
can be changed later. Use the main form for Reviews. Once you
are on a specific Review you can set the RecordSource for the subform
so that ReviewDetails can be edited/added to. The code for adding
a new line (if you use code here) needs to ensure that the current
ReviewID gets duplicated and that an appropriate ReviewDetailID
(perhaps AutoNumber) gets assigned.

Alternatively, you can have a subform for Reviews and another subform
for ReviewDetails. On the Form_Current() event of the first subform
you can Call Form_frmMain.RequerySubformDetails(CStr(Me.ReviewI D))
where:

Public Sub RequerySubformDetails(strReviewID As String)
'Set SubformDetails.Visible = false in Design mode and make visible to
make startup act reasonable
If SubformDetails.Visible = False Then
SubformDetails.Visible = True
Exit Sub
End If
SubformDetails.Form.RecordSource = "SELECT * FROM ReviewDetails WHERE
ReviewID = " & strReviewID & " ORDER BY ReviewDetailID;"
SubformDetails.Form.Refresh
'This line might be superfluous:
SubformDetails.Form.Repaint
End Sub

is behind frmMain. Then when you click on a Review in the top
subform, the corresponding ReviewDetail records show up in the bottom
subform. There are even other ways to accomplish this. The structure
you showed makes it difficult to find any reasonable way to get what
you want. Plus, you are no longer limited to a 50 group audit (groans
coming from the auditors).

James A. Fortune
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: April | last post by:
I am working on a database to be used for auditing medical groups. TABLE:DETAILS contains these fields: (autonumber) 50 group fields through each a combo box that pulls from the same...
3
by: Ron Nolan | last post by:
I have a large application that contains lots and lots of financial history data. The history data is currently set up in a table called 'TblHist' that exists inside each of these three .mdb...
4
by: carl.barrett | last post by:
Hi, I have a list box that displays 2 columns. Behind it sits a query with five columns. These are Column1 (DOB), column2 (a concatenated string of Surname Forname, Title), Column3 (Surname),...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
19
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: jennk | last post by:
i am working in Access 97, our database tables are linked from ODBCsqlsvr (not even sure what that means). i have a table where each record has a unique customer and their order information. there...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
0
by: redpears007 | last post by:
Morning all! :) I have a database with multiple linked tables. I have created a search form with one txt box, for entering search criteria, and a listbox for each of the tables to isplay the...
2
by: dlevene | last post by:
Hi - newbie here, be gentle. In Access 2003, I've created a report (based on a query) to produce mailing labels for all records where = "Community". is a combo-box field with the values coming from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.