Help with database.

S

Suzanne Wyatt

I have with much help from PC Datasheet a survey database designed to aid in
contacting clients post discharge on several different time frames. I am
using a combo box to select the contact interval (ie.., 1 month, 6 months,
etc.) question is: is there a way I can lock this box, so that it cannot
be changed until a successful contact is made for that criteria, so that a
user doesn't accidently change the contact interval which could skew
results. TIA Suzanne Wyatt
 
R

Richard Choate

Set the locked property to "true" with a line of code in the afterupdate
event of the combo. Then, just set it back after the contact is made.
Richard Choate

I have with much help from PC Datasheet a survey database designed to aid in
contacting clients post discharge on several different time frames. I am
using a combo box to select the contact interval (ie.., 1 month, 6 months,
etc.) question is: is there a way I can lock this box, so that it cannot
be changed until a successful contact is made for that criteria, so that a
user doesn't accidently change the contact interval which could skew
results. TIA Suzanne Wyatt
 
S

Suzanne Wyatt

Would that be done in an If then else statement?
and if so, how do I write the code.
 
R

Richard Choate

To set:

Private Sub cboMyCombobox_AfterUpdate()
Me.cboMyCombobox.Locked = True
End Sub

To reverse it, you would use an if statement. For instance, once a contact
is made, perhaps another control like a textbox becomes populated. If you
want to unlock the combo that way, you could put the reverse code in the
"ongotfocus" event of the combo. This basically works by checking for
something as soon as the combo gets focus. If that test returns true, then
unlock the combo.

Private Sub cboSSN_GotFocus()
If isnull(Me.txtSomeTextbox) = false Then
Me.cboMyCombobox.Locked = false
End If
End Sub

Richard



Would that be done in an If then else statement?
and if so, how do I write the code.
 
S

Suzanne Wyatt

Thanks for your input
Richard Choate said:
To set:

Private Sub cboMyCombobox_AfterUpdate()
Me.cboMyCombobox.Locked = True
End Sub

To reverse it, you would use an if statement. For instance, once a contact
is made, perhaps another control like a textbox becomes populated. If you
want to unlock the combo that way, you could put the reverse code in the
"ongotfocus" event of the combo. This basically works by checking for
something as soon as the combo gets focus. If that test returns true, then
unlock the combo.

Private Sub cboSSN_GotFocus()
If isnull(Me.txtSomeTextbox) = false Then
Me.cboMyCombobox.Locked = false
End If
End Sub

Richard



Would that be done in an If then else statement?
and if so, how do I write the code.
aid
 

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