Re: checkboxes on a form and values in a table
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 10/07/04
- Next message: Tim Ferguson: "Re: Supressing unwanted 'update row warning' dialog"
- Previous message: fredg: "Re: Remove text from field"
- In reply to: SabreWolf3: "checkboxes on a form and values in a table"
- Next in thread: Marshall Barton: "Re: checkboxes on a form and values in a table"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 8 Oct 2004 00:26:43 +0800
Hmm. A bit field, interfaced with 5 unbound check boxes.
In Access it's probably better to use the AfterUpdate event of the text
boxes to calculate the bit value, and write to your integer field.
All references in a bound form are automatically the current record. The
field you are writing to does not have to be represented by a text box: so
long as it appears in the form's RecordSource.
When you move record, the Current event of the form fires, so that's the one
you need to use to parse the bit-field and set your text boxes. You should
also use the Undo event of the form, to reset the textboxes, based on the
OldValue of the bit-field.
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "SabreWolf3" <SabreWolf3@discussions.microsoft.com> wrote in message news:D42A5006-A004-4B29-BDCE-05413F20C870@microsoft.com... > Hi all, > > I am very new to access, but I do have some VBA experience. > > I have created a form with 5 checkboxes that represent contact methods for > customers (Mail, phone, email, pager, other). Any combination from all > blank > to all checked is possible, which is 32 distinct possibilities. Here are > the > two things I want to do, but I just do not know how to accomplish them in > Access. > > As the user checks the checkboxes, I will use the OnClick method to > evaluate > the state of all 5 checkboxes. Based on which checkboxes are selected, I > want to write a binary value from 0 to 31 into the "contact method" field > of > the current record. In VBA, I do not know how to reference the current > record, nor the current field to write the value. Can someone help with > this? The form name is frm:Master_Form, the table name is > tbl:Master_Table > and the field name is Contact Method. > > Secondly, the form contains the record navigation controls at the bottom. > When a user clicks on any of those controls to change records, what event > can > I use to evaluate the Contact Method field for the currently selected > record, > so that I can check the appropriate checkboxes? What would that code look > like? > > Many thanks, > Richard
- Next message: Tim Ferguson: "Re: Supressing unwanted 'update row warning' dialog"
- Previous message: fredg: "Re: Remove text from field"
- In reply to: SabreWolf3: "checkboxes on a form and values in a table"
- Next in thread: Marshall Barton: "Re: checkboxes on a form and values in a table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|