473,493 Members | 4,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding records to a filtered form

OK, here's my dilemma. I am trying to create a system to track cases
and clients. There are instances when cases have multiple clients, and
there are instances where clients have multiple cases. I have several
tables to house all the information, but the three that connect the
dots are

tblClients
tblCases
tblCaseClients

tblCaseClients contains CaseClientID (primary Index), ClientID, CaseID

I have the following forms: frmCaseTabs whose recordsource is tblCases
frmClients whose recordsource is tblClients
frmCaseClients whose recordsource is tblCaseClients, and it appears as
a subform on both the frmCaseTabs and frmClients

I am having trouble creating a screen on the frmCaseTabs where I can
add an new client to an existing case, because the subform showing the
clients is filtered, therefore I cannot add another one. I know I can
accomplish this somehow, but my brain is fried right now and I can't
come up with the solution. Any help would be greatly appreciated.

Thanks,
Dave

Nov 13 '05 #1
3 1667
Have a command button on the main form that inserts a new client. I
suggest in that case you develop a small dialog box to choose one. Or,
display an otherwise hidden combobox, again on the main form.

When the new client is inserted, you can issue Me.Recalc (does a Requery
on listboxes, comboboxes and subforms)

db******@yahoo.com wrote:
OK, here's my dilemma. I am trying to create a system to track cases
and clients. There are instances when cases have multiple clients, and
there are instances where clients have multiple cases. I have several
tables to house all the information, but the three that connect the
dots are

tblClients
tblCases
tblCaseClients

tblCaseClients contains CaseClientID (primary Index), ClientID, CaseID

I have the following forms: frmCaseTabs whose recordsource is tblCases
frmClients whose recordsource is tblClients
frmCaseClients whose recordsource is tblCaseClients, and it appears as
a subform on both the frmCaseTabs and frmClients

I am having trouble creating a screen on the frmCaseTabs where I can
add an new client to an existing case, because the subform showing the
clients is filtered, therefore I cannot add another one. I know I can
accomplish this somehow, but my brain is fried right now and I can't
come up with the solution. Any help would be greatly appreciated.

Thanks,
Dave


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #2
The main form is called frmCaseTabs, it's recordsource is the tblCases
table. If I add a button to add a new record, it will be a new Case
record, not a new Client record. The first tab contains the case
information, the second tab contains a subform showing the clients on
that case (obviously filtered). The way I have it working currently is
that you can open the frmClients and add people, then you close that
form and open the frmCaseTabs form where you fill out the case
information, and choose the clients from a drop down list of all
clients in the database. This updates the table tblCaseClients with
the CaseID and ClientID and creates a primary index called
CaseClientID. So my problem is that because I have this intermediary
table between the tblCases and tblClients, I can't figure out how to
add a client from within the frmCaseTabs screen. The recordsource is
not the table tblCaseClients. The subform containing that information
is on the second tab, and it's recordsource is qryCaseClients which
shows all clients under this case number.

If I am going to add a new client from this screen, I really need to
set it to populate the tblCaseClients table as well as the tblClients
table. It would have to set the CaseID in tblCaseClients, and it would
have to set the ClientID to whatever the new ClientID is when the new
person is created. It sounds so confusing, but I know it's quite
simple, but I just can't figure it out.

Thanks,
Dave

Nov 13 '05 #3
The main form is called frmCaseTabs, it's recordsource is the tblCases
table. If I add a button to add a new record, it will be a new Case
record, not a new Client record.
That is not automatically. You can make a button any way you like. But
it is probably not the best place, indeed.
The first tab contains the case
information, the second tab contains a subform showing the clients on
that case (obviously filtered).
That would be the logical place for the 'add client' button. I
understand you add an existing client to this case, on that particular spot?

The way I have it working currently is that you can open the frmClients and add people, then you close that
form and open the frmCaseTabs form where you fill out the case
information, and choose the clients from a drop down list of all
clients in the database. This updates the table tblCaseClients with
the CaseID and ClientID and creates a primary index called
CaseClientID. So my problem is that because I have this intermediary
table between the tblCases and tblClients, I can't figure out how to
add a client from within the frmCaseTabs screen. The recordsource is
not the table tblCaseClients. The subform containing that information
is on the second tab, and it's recordsource is qryCaseClients which
shows all clients under this case number.
Is that query not updatable, then? And why do you use a query at all?
Provided you have LinkMasterFields and LinkChildFields correctly set up,
you will automatically see just the clients for this case.
If I am going to add a new client from this screen, I really need to
set it to populate the tblCaseClients table as well as the tblClients
table.


You would choose the client from a combobox based upon tblClients. Set
its LimitToList property to Yes (or True or what is it), and use the
NotInList event to trigger the complete new client insertion procedure.
At the end of this event procedure, do Response=acDataErrAdded.
If NotInList doesn't fire, it means the user selected an existing client
to be added to this case.
Both ways, the client gets added to the case.

Maybe it's just qryCaseClients that frustrates function here.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #4

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

Similar topics

6
18744
by: Ian Davies | last post by:
Hello all I have the following PHP script to place records from my MySql db into a table. However I now wish users to beable to select the multiple records from the table and on clicking a button...
2
4778
by: origin197511 | last post by:
Hello all... I'm having an issue with MSAccess 2000. I have a Form that holds records of my cartridge loads for a rifle and a subform that lists all groups that have been fired with that load. ...
2
8051
by: Zeljko | last post by:
I'm creating Address book. Header of the main form (frmAddress) contains combo box (cboFilter) to filter records by Occupation on main Form(Ocupation1). That's working. Combo box also have "Show...
3
3431
by: melnhed | last post by:
---Report the current filtered records from a Form--- Hello All, I've seen this topic discussed before, but the solution described then doesn't work in my particular case. My Config: ...
6
2314
by: paulcrowsnest | last post by:
I have a master form (clients), and 2 subforms (invoice and credit account details). This all works great. ive added a command button in the master form (clients) to open a new form as a popup where...
0
1657
by: Ironr4ge | last post by:
Hi everyone, By the rate its going it want be long till I start growing gray hair... but anyway.. to come to the point... I am trying to open the form "Languages" with a diffrent record...
4
2917
by: Ironr4ge | last post by:
Hi everyone, I am trying to open the form "Languages" with a diffrent record source to the "Contacts" form where I conducted the search or filter... . I was wondering whether there was a vba...
6
1946
by: Nettle | last post by:
Purpose: I am creating a mailing distribution list database. Users should be able to filter/search contacts and add them to distribution lists they have created. My problem? I can't add multiple,...
6
2348
jinalpatel
by: jinalpatel | last post by:
I am using following code for searching records. 'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter. 'Notes: 1. We tack " AND " on...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.