User defined form load options

  • Thread starter gsnidow via AccessMonster.com
  • Start date
G

gsnidow via AccessMonster.com

Greetings all. I am using Access 2003 .ADP with SQL Server 2000. I have a
search popup where the user makes choices from some combos, and the SQL is
generated behind the scenes. I have been asked to include some option
buttons that could be used to further restrict the records. So far I have
two option buttons, and I have set the default value to -1 on the form's load
event, like the below...

Private Sub Form_Load()
On Error GoTo Err_Form_Load

Me.optExcludeComplete = -1
Me.optExcludeSplitter = -1

Exit_Form_Load:
Exit Sub

Err_Form_Load:
MsgBox Err.description
Resume Exit_Form_Load

End Sub

My question is, if a user wants the default for either or both of them to be
0 instead of -1, how can I approach this. It seems like I would need to
allow users to alter the sub, and I'm not sure how I could do this. Thank
you

Greg
 
D

Dirk Goldgar

gsnidow via AccessMonster.com said:
Greetings all. I am using Access 2003 .ADP with SQL Server 2000. I have
a
search popup where the user makes choices from some combos, and the SQL is
generated behind the scenes. I have been asked to include some option
buttons that could be used to further restrict the records. So far I have
two option buttons, and I have set the default value to -1 on the form's
load
event, like the below...

Private Sub Form_Load()
On Error GoTo Err_Form_Load

Me.optExcludeComplete = -1
Me.optExcludeSplitter = -1

Exit_Form_Load:
Exit Sub

Err_Form_Load:
MsgBox Err.description
Resume Exit_Form_Load

End Sub

My question is, if a user wants the default for either or both of them to
be
0 instead of -1, how can I approach this. It seems like I would need to
allow users to alter the sub, and I'm not sure how I could do this. Thank
you

Greg


Do you mean that different users should be able to set a preference for the
default values of these option groups? You'd need to store those
preferences somewhere. One way to do this would be to have a configuration
table of some sort, indexed by user. Another way would be to store them as
custom properties of the form. Either way, your Form_Load procedure would
be modified to get the user's preferences from wherever they were stored,
and use them to set the initial values of the option groups.
 
G

gsnidow via AccessMonster.com

Thanks Dirk. I was thinking I would have to go the table route, and that
will probably be easiest. I was not sure if there was another way. Thanks
for the quick reply.

Dirk said:
Greetings all. I am using Access 2003 .ADP with SQL Server 2000. I have
a
[quoted text clipped - 27 lines]

Do you mean that different users should be able to set a preference for the
default values of these option groups? You'd need to store those
preferences somewhere. One way to do this would be to have a configuration
table of some sort, indexed by user. Another way would be to store them as
custom properties of the form. Either way, your Form_Load procedure would
be modified to get the user's preferences from wherever they were stored,
and use them to set the initial values of the option groups.
 

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