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 i can view information about the credit payment history, when i created the command button i used the "open the form and find specific data to display" option, i then linked the new form to only display data that is relevent to the master form(clients) data currently displayed. Again this works fine, the popup form only shows these filtered records.
My problem is, when i goto add a new record all the filtering is lost and i have to use the combo box, with its list of names, to get the relevent client name again, i knew it would do this, but what i dont know is how can I force the combo box to display the clients name that is being used on the filtered popup form.
It realy has me stumped, i dont want to take the chance that the end-user puts in the wrong client name.
Any help would be well appreciated, and i can then get a good nights sleep.
6 2315 Rabbit 12,516
Recognized Expert Moderator MVP
I suppose you can extract the client name that is being used in the filter and use that to fill in the name for your new record. You could also lock the field to prevent people from tampering with it.
Cheers Rabbit, although i do a fair bit of VB etc in web design ASP.net, i am quite new to Access, and i have found lots of info on the net to help me along, but again, my problem is that when you say extract the filtered name from the form, i go derrrr, what does that mean and how do i do that, if you could expand on that statement i would be grateful. i will look tho to see if i can figure it out based on your comments, cheers
Rabbit 12,516
Recognized Expert Moderator MVP
Well, if there is a filter on the form. Then the form's Filter property will have the string statement that filter's it. Something along the lines of: - Filter = ((tbl_Data.[Client Name] = "Bob"))
You should be able to pull that substring out, i forget the exact function.
NeoPa 32,557
Recognized Expert Moderator MVP
Well, if there is a filter on the form. Then the form's Filter property will have the string statement that filter's it. Something along the lines of: - Filter = ((tbl_Data.[Client Name] = "Bob"))
You should be able to pull that substring out, i forget the exact function.
If your filter (Me.Filter) is of the form described by Rabbit, then some code along the lines of the following should extract the value out of it. I'm searching for the (") char (Better to use (') in SQL strings though) and using its positions to formulate the string. - Dim strName As String
-
Dim intQPos As Integer
-
-
intQPos = InStr(1,Me.Filter,"""")
-
strName = Mid(Me.Filter,intQPos)
-
intQPos = InStr(1,strName,"""")
-
strName = Left(strName,intQPos-1)
Thanks guys for the help, sorry for the delayed response, been away (got Married :(
Because the subform is linked to the mainform via ClientID i found that if i present the subform with "Data-Allow Additions" set to True it automatically inserted the ID into the subform for me i then just added the other data fields and added the new record, i stumbled on it by accident on another form i was working on, it seems to do what i want.
thanks again for your assistance, it is appreciated
NeoPa 32,557
Recognized Expert Moderator MVP
Thanks guys for the help, sorry for the delayed response, been away (got Married :(
Because the subform is linked to the mainform via ClientID i found that if i present the subform with "Data-Allow Additions" set to True it automatically inserted the ID into the subform for me i then just added the other data fields and added the new record, i stumbled on it by accident on another form i was working on, it seems to do what i want.
thanks again for your assistance, it is appreciated
No problem - glad you found a good solution.
Congratulations on your nuptials btw :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike |
last post by:
I have a form that certain information on it. On this form there is a
button that opens a payment form.
When the payment form opens I enter a payment type, check cash charge,
payment number,...
|
by: Mathew Hill |
last post by:
I am a beginner to the more technical aspects of Microsoft Access
(2000) and was wondering if any one can help. I have 3 buttons on a
form which add, delete and search for a record. However, when I...
|
by: Robin S. |
last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope
I've done a better job of explaining myself below.
I am trying to produce a form to add products to a table (new...
|
by: brenda.stow |
last post by:
error msg " An error occured while referencing the object. You tried to
run a visual basic procedure that improperly references a property or
method of an object"
This msg occurs everytime I add a...
|
by: Jim Heavey |
last post by:
Trying to figure out the technique which should be used
to add rows to a datagrid. I am thinking that I would
want an "Add" button on the footer, but I am not quite
sure how to do that. Is that...
| |
by: shumaker |
last post by:
I'm wondering if adding an autonumber primary key will improve the
performance of a multiuser access database on a network share. I have
a website that lists many tips for improving performance of...
|
by: Ron |
last post by:
Hi All,
Using Access2000, winXP.
Table 1 = tblClients displayed on frmClients via qryClients. 2nd table =
tblInvoices shown on frmInvoices via qryInvoices. 2nd table = tblDetails
shown on...
|
by: ConfusedMay |
last post by:
Hi,
I'm working on a database that has a form which hold all of our products testing. each product can hold more than 1 complete test (complete test here means that product has to have before and...
|
by: raaaz |
last post by:
Hi dears,
I am adding a record in Access database using AddNew method of recordset. here is the code of the page ..
<%
Set RsLibBuild = Server.CreateObject ("ADODB.Recordset")...
|
by: raaaz |
last post by:
Hi All,
I am having a totaly different sort of problem which is out of my efforts now so may be any one out of you might help me out of this.
I am using very simple code below to add a record...
|
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,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |