Option Group Query

M

Mr-Re Man

I have included an option group with radio buttons on my form, however you
can only select an option if you tab (to go forward) or shift+tab (to go
backwards).

I have been trying everything to correct it, so I just thought I would post
it on here instead.
 
J

Jeff Boyce

I'm not sure I understand "only select an option"...

Do you mean you are unable to use the mouse and click in a radio button? If
so, what property settings does that control have?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Mr-Re Man

Hi Jeff, I'll try to explain what i have done.

I initially created a form to record visitors coming into a reception area,
the form has 20 buttons that represent the type of customers we see. So I
created this form that had no record source as the data was being captured on
the click of a button (code below courtesy of Klatuu) that would call on a
module.

Public Sub AddActivity(ActivityLog, EnquiryType, Date1 As String)
Dim strSQL As String

On Error GoTo AddActivity_Error

strSQL = "INSERT INTO tblActivityLog (Activity, TypeID, LogDate,
LogTime, ComputerName) " & _
"SELECT """ & ActivityLog & """ AS Expr1, """ & EnquiryType &
""" AS Expr2, """ & Date1 & """ AS Expr3, #" & Time & "# AS Expr4, """ &
fOSMachineName & """ AS Expr5;"
CurrentDb.Execute strSQL, dbFailOnError

AddActivity_Exit:
On Error GoTo 0

Exit Sub

AddActivity_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure AddActivity of VBA Document Form_Form4"
GoTo AddActivity_Exit

End Sub

As time went on and the form proved to be successful, they wanted me to add
in an enquiry type, was the enquiry by email, telephone, face-2-face etc.

I went about by creating a table of enquiry types, [TypeID], [Type]

I then wanted to add the option group so they person could select whether it
was a email, telephone call first via a radio button, then press the button
that would call the module and fill in the details in the table.

However, this didn't work correctly. it wouldn't let me select a radio
button, each of the radio buttons has an option value that is the same as
their respective number in the tblTypes.

I then linked the main form to record source tblTypes and it started to
allow me to select the radio button, but only by tabbing through them, I
couldn't click on them. So at present it works, but not in the way I
expected it to.

If I take the tblTyoes out of the record source, it lets me click on the
radio buttons but the dot will not appear in the radio button that I select.

That's the background, please let me know what else you need to perhaps
provide the solution.
 
J

Jeff Boyce

If I'm understanding your description, you have 20 buttons, one each for
each type of customer.

This design is a maintenance nightmare! What happens when your line of
business decides there are 21 customer types, or 18 instead of 20? The form
needs to be altered, and any query, report, ?table, ?code, ... that relates
would also need revisiting.

Is there a reason you aren't using something like a combobox, which would
let you select a (single) customer type? If you used this approach, adding
(or removing) valid customer types would be as easy as doing the data entry
in the tlkpCustomerType table.

More info, please!

Regards

Jeff Boyce
Microsoft Office/Access MVP



Mr-Re Man said:
Hi Jeff, I'll try to explain what i have done.

I initially created a form to record visitors coming into a reception
area,
the form has 20 buttons that represent the type of customers we see. So I
created this form that had no record source as the data was being captured
on
the click of a button (code below courtesy of Klatuu) that would call on a
module.

Public Sub AddActivity(ActivityLog, EnquiryType, Date1 As String)
Dim strSQL As String

On Error GoTo AddActivity_Error

strSQL = "INSERT INTO tblActivityLog (Activity, TypeID, LogDate,
LogTime, ComputerName) " & _
"SELECT """ & ActivityLog & """ AS Expr1, """ & EnquiryType &
""" AS Expr2, """ & Date1 & """ AS Expr3, #" & Time & "# AS Expr4, """ &
fOSMachineName & """ AS Expr5;"
CurrentDb.Execute strSQL, dbFailOnError

AddActivity_Exit:
On Error GoTo 0

Exit Sub

AddActivity_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure AddActivity of VBA Document Form_Form4"
GoTo AddActivity_Exit

End Sub

As time went on and the form proved to be successful, they wanted me to
add
in an enquiry type, was the enquiry by email, telephone, face-2-face etc.

I went about by creating a table of enquiry types, [TypeID], [Type]

I then wanted to add the option group so they person could select whether
it
was a email, telephone call first via a radio button, then press the
button
that would call the module and fill in the details in the table.

However, this didn't work correctly. it wouldn't let me select a radio
button, each of the radio buttons has an option value that is the same as
their respective number in the tblTypes.

I then linked the main form to record source tblTypes and it started to
allow me to select the radio button, but only by tabbing through them, I
couldn't click on them. So at present it works, but not in the way I
expected it to.

If I take the tblTyoes out of the record source, it lets me click on the
radio buttons but the dot will not appear in the radio button that I
select.

That's the background, please let me know what else you need to perhaps
provide the solution.




Jeff Boyce said:
I'm not sure I understand "only select an option"...

Do you mean you are unable to use the mouse and click in a radio button?
If
so, what property settings does that control have?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top