473,401 Members | 2,139 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,401 software developers and data experts.

fields and forms

I have two tables and two forms, "Patient Details", "Placement
Details".

In the "Patient Details" form, I have the name and addresses fields. I
want to update the addresses fields automatically once the name field
has been filled in. I have tried Dlookup but what else have I missed
out on. Also the Gp Practice fields and the GP Code fields needs this
done as well.

=DLookUp("[Gpcode]","[Conwydata]","[Gpcode] =""" & [gp_practice] &
"""")

Is there something that I have missed to get this working.

Also

When the patient's name and data in the "Patient Details" form is
completed then I have
a button on that form to go to the "Placement Details" form but I would
like the "Patients name" autofilled on the 2nd form from the 1st form
when they click on the "Placement Details" button.

Private Sub Patientdetails_Click()
On Error GoTo Err_Patientdetails_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Placement Details"

stLinkCriteria = "[Fullname]=" & "'" & Me![surname] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Patientdetails_Click:
Exit Sub

Err_Patientdetails_Click:
MsgBox Err.Description
Resume Exit_Patientdetails_Click

End Sub
Anyone got any ideas as to where I am going wrong, new to MS Access -
got the fundementals right just got to get the Advanced stuff now, boss
said no money for courses so struggling on, on my own.

Elaine

Aug 21 '06 #1
1 1292
I think instead of all the DLookups, you would be better off to have
your form bound to the table. Make the record source of the form your
PatientDetails table. Now for each field on your form, make the
control source one of the fields in your table. When you create your
dropdown box, when the wizard starts select the third option. Find a
record based on the value I select. You should select the PatientID
and name fields.

If you want your name to display LastName, FirstName change the
rowsource of the dropdown to Select PatientID, Lastname & ", " &
FirstName From [Patient Details];
Change the number of colums to 2, the column widths to 0;1, and the
bound column should be 1.

For your other form, again have it bound to Placement Details. When
you open the form, your stLinkCriteria should be: PatientID =
Me.FullName
I chose FullName for the name of the drop down box. If you call it
something else, then substitute that name for FullName.

Hope that helps!
Elainie wrote:
I have two tables and two forms, "Patient Details", "Placement
Details".

In the "Patient Details" form, I have the name and addresses fields. I
want to update the addresses fields automatically once the name field
has been filled in. I have tried Dlookup but what else have I missed
out on. Also the Gp Practice fields and the GP Code fields needs this
done as well.

=DLookUp("[Gpcode]","[Conwydata]","[Gpcode] =""" & [gp_practice] &
"""")

Is there something that I have missed to get this working.

Also

When the patient's name and data in the "Patient Details" form is
completed then I have
a button on that form to go to the "Placement Details" form but I would
like the "Patients name" autofilled on the 2nd form from the 1st form
when they click on the "Placement Details" button.

Private Sub Patientdetails_Click()
On Error GoTo Err_Patientdetails_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Placement Details"

stLinkCriteria = "[Fullname]=" & "'" & Me![surname] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Patientdetails_Click:
Exit Sub

Err_Patientdetails_Click:
MsgBox Err.Description
Resume Exit_Patientdetails_Click

End Sub
Anyone got any ideas as to where I am going wrong, new to MS Access -
got the fundementals right just got to get the Advanced stuff now, boss
said no money for courses so struggling on, on my own.

Elaine
Aug 21 '06 #2

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

Similar topics

3
by: Young Seeker | last post by:
Hi, I created two forms using forms wizard. One was for a master table that has just an ID and Description column. Another was for a transaction table that has foreign keys from the master table...
6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
5
by: kaosyeti | last post by:
hey.. i have a report that is based on a 12 field simple query. i've been working on it for a while and had to restart some areas so i know i went over the 755 control limit but only until i reset...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
7
by: aharding | last post by:
Hello! I have a form that opens with the click of a toggle button on another form. I would like to link the child and parent fields of the forms for data input but am not experienced enough with...
1
by: munrrob | last post by:
MS Access 2002 SP 3 I have two forms, one with a combo box looking at available lookup tables and the other an unbound form which will be used by the user to update lookup values. The lookup...
7
by: Jon Slaughter | last post by:
I have some static fields in a class to keep track of "global" information but this information is local to each form that the class is used on. e.g., the class represents a base...
8
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains...
1
by: Dave | last post by:
I have multiple forms that will create an object. Basically a energy efficiency measure object. The measure object will have a couple of required properties set but after that it can have 10-20...
1
by: billypit | last post by:
Hi, In my project i have one table production.Now i have to make application in which i have to insert new data in table by fields of form made in access.I don't know how to use form field's values...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.