Option Group selection on open

A

Anne

I have an options group:
Private Sub JobSelectJobOption_AfterUpdate()
Select Case JobSelectJobOption
Case 1
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=False "
Case 2
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=true "
Case 3
Me.JobSelect.RowSource = "Select * from cbojobcontractor"
Me.requery
End Select
End Sub

It works, however, whenever I open the form, case 3 is selected which should
be all jobs, but it does not list all jobs, it lists the active jobs.
It shows all job, but displays only the active jobs. I have to check another
button and then again all jobs to actually display all jobs.
In any case, it should display which ever button is checked.
 
M

Mr. B

Anne,

If when you open your form the 3rd option is selected, then either you have
set the default of your group control to 3 or some code is setting that value.

As for the recrods not displaying, you need to move the Me.Requery to after
the End Select of your Case statement if you want the form to be requery
after the group control is updated.

HTH
Mr. B
askdoctoraccess dot com
 
A

Anne

It has been so long since I worked with an options group that I forgot. I
found that the default value of the group was set to 3. This options group is
for a combobox.

For a quick solution I made the default value 1. Now, at least, the checked
item corresponds to the values shown when the form opens. I moved the
me.requery to the right spot.


Mr. B said:
Anne,

If when you open your form the 3rd option is selected, then either you have
set the default of your group control to 3 or some code is setting that value.

As for the recrods not displaying, you need to move the Me.Requery to after
the End Select of your Case statement if you want the form to be requery
after the group control is updated.

HTH
Mr. B
askdoctoraccess dot com

Anne said:
I have an options group:
Private Sub JobSelectJobOption_AfterUpdate()
Select Case JobSelectJobOption
Case 1
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=False "
Case 2
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=true "
Case 3
Me.JobSelect.RowSource = "Select * from cbojobcontractor"
Me.requery
End Select
End Sub

It works, however, whenever I open the form, case 3 is selected which should
be all jobs, but it does not list all jobs, it lists the active jobs.
It shows all job, but displays only the active jobs. I have to check another
button and then again all jobs to actually display all jobs.
In any case, it should display which ever button is checked.
 
A

Anne

From my experience, the error message of 'invalid use of null' leads back to
the data. Perhaps in the conversion, something did not convert property and
there are errors in the underlying query.Check out the query data for errors.
 
A

Anne

Sorry, this got into the wrong message.

Anne said:
From my experience, the error message of 'invalid use of null' leads back to
the data. Perhaps in the conversion, something did not convert property and
there are errors in the underlying query.Check out the query data for errors.

Anne said:
I have an options group:
Private Sub JobSelectJobOption_AfterUpdate()
Select Case JobSelectJobOption
Case 1
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=False "
Case 2
Me.JobSelect.RowSource = "Select * from cbojobcontractor where [Archive]
=true "
Case 3
Me.JobSelect.RowSource = "Select * from cbojobcontractor"
Me.requery
End Select
End Sub

It works, however, whenever I open the form, case 3 is selected which should
be all jobs, but it does not list all jobs, it lists the active jobs.
It shows all job, but displays only the active jobs. I have to check another
button and then again all jobs to actually display all jobs.
In any case, it should display which ever button is checked.
 

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