Radio button insert TEXT instead of NUMERIC?

kawi6rr

Registered User.
Local time
Today, 04:24
Joined
Jun 29, 2010
Messages
28
I'm using Access 2010 and I’ve tried 2 different methods to get my radio button to insert text instead of numeric 1 or 2. This does the same thing with onClick and AfterUpdate.
METHOD NUMBER 1: This works but the radio button stay “grayed” out, they do not check off when clicked. “Me.Patient_location_30_days_post_discharge.Value” is a hidden field.
Private Sub rdoLocation_Click()
Select Case rdoLocation.Value
Case Is = "1"
Me.Patient_location_30_days_post_discharge.Value = "Home"
Case Is = "2"
Me.Patient_location_30_days_post_discharge.Value = "Hospital or Acute Care Facility"
Case Is = "3"
Me.Patient_location_30_days_post_discharge.Value = "Short term rehabilitation facility"
Case Is = "4"
Me.Patient_location_30_days_post_discharge.Value = "Chronic health care facility"
Case Is = "5"
Me.Patient_location_30_days_post_discharge.Value = "ND or Cannot be determined"
End Select
End Sub
METHOD NUMBER 2: I tried using a DAO insert statement but it just inserts 1 or 2 into the field. I went into the reference library to check of DAO but I get this error “Name conflicts with existing module”
Private Sub Frame97_Click()
Dim addPatientLocation As Integer
Dim Outcome As DAO.Database
Dim Patient As DAO.Field
Set dbsOutcome = CurrentDb
Set rstPatientLocation = dbsOutcome.OpenRecordset("Patient")
With dbs
Select Case Frame97.Value
Case Is = "1"
rstPatientLocation.AddNew
rstPatientLocation.Patient_location_30_days_post_discharge.Value = "Home"
Case Is = "2"
rstPatientLocation.AddNew
rstPatientLocation.Patient_location_30_days_post_discharge.Value = "Hospital or Acute Care Facility"
End Select

rstPatientLocation.Update
End With

End Sub

Any help is apprecaited, thanks!
 
You are much better off with a number than Text. A join with a Lookup table would give you the text in a query.
 
Why do you want to store text values rather than the numeric values :confused:

By doing this you are de-normalising your data. YOu are far better off using the sort of code you have above at time you wish to re-display the data.
 
The high altitude allows me to type faster than John! :p:p
 
This oxygen rich environment is clearly doing me no favours :D

I'll have to looking to getting a hyperbaric chamber installed ;)
 
Sure it does. You answers are always spot on and worth reading.
 
8300' is an impressive altitude given that the highest point here in Aus. is 7300' :)
 
For simplicity on the querying side, we have a few people in the office including my boss who like to think they can do it themselves but they dont realize the effort on my end to make them feel tech savy.
 
I'd not be letting users, of any flavour, mess around in the back end of a DB. It's a recipe for disaster. Imagine if they accidentally created a delete query and wiped all you data :eek:
 
I guess it would have looked something like;

attachment.php


:D
 

Attachments

  • Capture.PNG
    Capture.PNG
    71.8 KB · Views: 578

Users who are viewing this thread

Back
Top Bottom