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

Autofill

1
I am creating a form to enter patient information. Patient are identified by their medical record number. Patients can an will be return patients so there will be multiple records on patients. When I enter their medical record number, I would like other information such as name and address to autofill if they have been a patient before. How do I set this up?
Aug 11 '08 #1
1 1127
ADezii
8,834 Expert 8TB
  1. Let's assume you have a Table named tblPatients with the following Fields:
    1. [RecordNumber]
    2. [FirstName]
    3. [LastName]
    4. [City]
    5. [State]
    6. [Zip]
  2. Let's also assume you have a Form with the following Fields (Text Boxes) :
    1. [txtRecordNumber]
    2. [txtFirstName]
    3. [txtLastName]
    4. [txtCity]
    5. [txtState]
    6. [txtZip]
  3. Place the following, or similar, code in the AfterUpdate() Event of txtRecordNumber:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub txtRecordNumber_AfterUpdate()
    2. Dim txtRecID As TextBox
    3.  
    4. Set txtRecID = Me![txtRecordNumber]
    5.  
    6. If Not IsNull(txtRecID) And IsNumeric(txtRecID) Then        'legitimate value for Record Number?
    7.   'Is there a Patient with this Record Number?
    8.   If DCount("*", "tblPatients", "[RecordNumber] = " & txtRecID) <> 0 Then
    9.     Me![txtFirstName] = DLookup("[FirstName]", "tblPatients", "[RecordNumber] = " & txtRecID)
    10.     Me![txtLastName] = DLookup("[LastName]", "tblPatients", "[RecordNumber] = " & txtRecID)
    11.     Me![txtAddress] = DLookup("[Address]", "tblPatients", "[RecordNumber] = " & txtRecID)
    12.     Me![txtCity] = DLookup("[City]", "tblPatients", "[RecordNumber] = " & txtRecID)
    13.     Me![txtState] = DLookup("[State]", "tblPatients", "[RecordNumber] = " & txtRecID)
    14.     Me![txtZip] = DLookup("[Zip]", "tblPatients", "[RecordNumber] = " & txtRecID)
    15.   Else
    16.     MsgBox "No Patient exists with a Record Number of [" & txtRecID & "]"
    17.     'Should also clear Fields on any prior entries
    18.   End If
    19. Else
    20.   MsgBox "Invalid entry for Record Number"
    21. End If
    22. End Sub
  4. Let me know if you have any questions.
Aug 11 '08 #2

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

Similar topics

0
by: Chris Sharman | last post by:
I'd like to design my pages to work cooperatively with browser autofill features. I've loked around, but can't find any good documentation on supported/unsupported field names...
1
by: shortbackandsides.no | last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar autofill to act consistently, for example ======================= <html><head> <title>autofill test</title> </head><body>...
0
by: David Portabella | last post by:
Hello, I am a doing a survey about Autofill Web Forms softwares. Usually, they all collect information of the user once during the set-up phase (user knowledge base). Then, when the user...
3
by: Anks | last post by:
Hi All, A user can control the AutoFill option by enabling / disabling the Remember Passwords option in Options - Privacy - Saved Passwords section. But is it possible to disable this option...
0
by: Ray Holtz | last post by:
Is it possible to autofill a field based on what is entered into another field in a form? My form has an employee field, and department field. In an Items Table, I have fields FldEmployee, and...
1
by: Nick J | last post by:
Hi, I remember at one point access would autofill a text box when filtering by form, Like for example as I would type it would come up with matching records, similar to AutoComplete in Internet...
2
by: Andre Ranieri | last post by:
I'm retouching our corporate web site that, among other things, allows customers to log in and pay their invoices online. I noticed that on the checkout page, the credit card number textbox...
4
by: HTS | last post by:
I have written a membership database application (PHP + mySQL) and need to prevent autofill from filling in fields in a member record edit form. I know I can turn off autoFill in my browsers, I...
1
by: Rissoman | last post by:
Hello, I have an issue were I have a zipcode textbox in an atlas ajax updatepanel. When you tab out of the zip textbox and the shipping is calculated. I know this works perfect! Then a user...
0
by: Randy | last post by:
Hi, I have some comboboxes that are created dynamically at run time based on user actions. I found a procedure on a message board to autofill the combobox text from the dataview that the...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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.