how to update the form and the record selector in the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Private Sub chkAllData_Click()
If chkAllData.Value = -1 Then

cmboSymbol.RowSource = "SELECT distinct [TradeDiary].[Symbol] FROM
[TradeDiary] " & _
" WHERE TradeDiary.Action <> 'Ignore' ORDER BY
[Symbol];"
cmboSymbol.Requery

Me.Form.Refresh

When i click on a check box, i want to run a different query and return
different rows to my combo box. i tried the above but it still does not work.
how do i fix it
thanks in advance
 
What does "does not work" mean? Do you get an error? If so, what's the
error? Do you get the wrong results? If so, is there some pattern that you
can see to the wrong results?
 
The problem that i see is that the record counter below does not change. the
original query is select * from TradeDiary.Action. So when i run the
Me.Form.Refresh, i expect the no of records to be lower. However the counter
in the recordselector on the form does not change.

Douglas J. Steele said:
What does "does not work" mean? Do you get an error? If so, what's the
error? Do you get the wrong results? If so, is there some pattern that you
can see to the wrong results?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Seede said:
Private Sub chkAllData_Click()
If chkAllData.Value = -1 Then

cmboSymbol.RowSource = "SELECT distinct [TradeDiary].[Symbol] FROM
[TradeDiary] " & _
" WHERE TradeDiary.Action <> 'Ignore' ORDER BY
[Symbol];"
cmboSymbol.Requery

Me.Form.Refresh

When i click on a check box, i want to run a different query and return
different rows to my combo box. i tried the above but it still does not
work.
how do i fix it
thanks in advance
 
That code looks as though it should work. Are you sure it's actually getting
executed? Try putting a MsgBox inside the If statement just to see whether
it is.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Seede said:
The problem that i see is that the record counter below does not change.
the
original query is select * from TradeDiary.Action. So when i run the
Me.Form.Refresh, i expect the no of records to be lower. However the
counter
in the recordselector on the form does not change.

Douglas J. Steele said:
What does "does not work" mean? Do you get an error? If so, what's the
error? Do you get the wrong results? If so, is there some pattern that
you
can see to the wrong results?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Seede said:
Private Sub chkAllData_Click()
If chkAllData.Value = -1 Then

cmboSymbol.RowSource = "SELECT distinct [TradeDiary].[Symbol]
FROM
[TradeDiary] " & _
" WHERE TradeDiary.Action <> 'Ignore' ORDER
BY
[Symbol];"
cmboSymbol.Requery

Me.Form.Refresh

When i click on a check box, i want to run a different query and return
different rows to my combo box. i tried the above but it still does not
work.
how do i fix it
thanks in advance
 
Back
Top