option button detail and dlookup prob

  • Thread starter Thread starter Baz
  • Start date Start date
B

Baz

Hi,

Anyone know how I can get detail about the radio button
that is pressed inside an option group... i.e. in the VB
can get the button name? If I say activecontrol.name it
gives the name of the group frame. Any ideas? The caption
of the active radio's label would also be helpfile.

Secondly, I am having dlookup problems within a form
too... I'm trying to do it outside of VB though:
I might need a bit of help on this actually...

There is a table (Clients) with fields [client name] and
[client code]. I import a table every week (Activity) with
the activity that includes both of these client fields as
part of the recordset. What I want to do is check the
import with what exists on the Clients table, and if there
is a client there not on my client table, I want to add it.

I created a form (frmClients) showing the fields txtclname
and txtclcode (as with the Clients table) - clname from
Clients.[client name] which looks up distinct
activity.client. I want to write a dlookup for txtclcode
to get activity.[client code] which will be forced into
the Clients table.

Could someone please give me some guidance on this, or the
radio button prob (or both if I'm really lucky!).

Thanks loads for time and efforts!

Baz (not the same one as below)
 
The Option Group's value will be the value associated with the selected
radio button. As long as you've given each radio button a sequential number,
you can find out the name of the radio button as

Me.Frame0.Controls(Me.Frame0.Value).Name

(replace Frame0 with whatever your option group is called)

If you haven't numbered them sequentially, you'll have to loop through all
the controls in the Option Group's Controls collect, check each one's value
against the selected value.

Not sure I understand your other question.
 
Back
Top