473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to make joined fields automatically filled on a form based on value in other?

Hi everybody
my question is very simple (hope so)
I have two forms named PatientData and NOK. PatientData form is based on table PatientData with PatientID as primary key. NOK form is based on a Table NOK with its own primary key ID and has a field PatientID that is joined with PatientID in PatientData table. I have a cmdButton_NOK on form PatientData that is used to open the form NOK based on a macro with where condition [PatientID]=[Forms]![PatientsData]![PatientID]
when I click the cmdButton_NOK, it opens the form NOK and displays the NOK entry. But if I try to add a 2nd entry related to current PatientID, PatientID field remains blank and is not filled automatically.....
Can there be a way that when I add 2nd related entry in NOK form PatientID field should be filled automatically...?????
Apr 25 '11 #1
1 1464
TheSmileyCoder
2,322 Expert Mod 2GB
What you need to do, is to set the default value of the field containing your PatientID to whatever your current working PatientID is.

I would suggest that you pass the patientID as part of the openArgs, and in the open event of your NOK form, you modify the default value of the PatientID field.

I hope that was helpfull to you.
Apr 25 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Oleg | last post by:
Hello there: I've been trying to create two different sets of required fields in one form and to use a radiobutton as sort of a switcher between these sets. In my HTML form there are two...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
2
by: allyn44 | last post by:
Hello, I have a form that I need to transfer some of the info into a second form based on a different query. The Id field is the same for data sources for both forms, but are based on...
2
by: PerryC | last post by:
Scenario: FormA: Field1, Field2 (Field1 is a combo box based on a NameTable w/ Name and phone fields) When users choose Field1 with Name1 (in record1 of NameTable), Field2 will...
2
by: bufbec1 | last post by:
I am pretty good with Access, but do not understand VBA. I have researched this topic and see only VBA answers, so I hope someone can help with my specific question. I have 2 fields for an...
1
by: Andy Davis | last post by:
I have a table of agent names and address details and I would like to automate the data entry process of these records on a form. If a user selects a particular agent say, upon selection of this...
5
by: aharding | last post by:
I would like to autopopulate fields in a form by choosing one value from a table and having the corresponding data filled in based on 'Library' tables I have made. I have been successful in building...
1
by: jl2886 | last post by:
Private Sub AM_Best_Rating_Click() Me.AM_Best_Rating = DLookup("", "ICNameRating", "=" & Me.Insurance_Company) End Sub Me.AM_Best_Rating the value I want to be automatically input....
5
by: karsagarwal | last post by:
I have a bounded form and after I click the button to update/save. THe fields are still there. Is there a way to clear off the fields in the bounded form. Thanks, SA Here's the code that I...
1
by: zoeb | last post by:
Currently I have a table, and would like the calculate a field in the table by referencing values from another 3 tables. i.e. tblData Index1, Index2, Index3, Value 1 2 3 2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.