M
Mark R.
What I want: when I click on my combobox, it prompts me
to input a date upon which to to select records from the
table to list in the combo box
What I got: the combobox only prompts me the first
time I click it, not subsequent times.
Why I think this happened: I used Parameter in my query
and not input box
What I've tried: assigning an input box output to
a "dim variable name as date" in Gotfocus or Click, but to
no avail
Current Code: in the rowsource of the combox is this
query:
Parameters(beginningDate]DateTime;
Select table.ID, table.yada
from table
where(
(table.xdate>=beginningdate And
table.xdate<=(beginningdate+1)
))
Order by table.ID
In code I have:
Private sub comboselectdate_Afterupdate()
Dim rs as DAO.recordset
Set rs = Me.RecordsetClone
With rs
..Findfirst "ID = " & Me.Comboselectdate
..Edit 'Mode
!Combodate = Date
..Update
Me.Bookmark = .Bookmark
End With
Me.Combo39.Requery
Me.Combo43.Requery
End Sub
This all does prompt me for a date, select table records
for the date, list the date in the combobox, and if I
select one of those records in the list, that record
appears in Combobox39 and Combobox43 as I want.
But again, if I go to select a different date, it does not
prompt me for a date again, it just uses the first date
originally input.
to input a date upon which to to select records from the
table to list in the combo box
What I got: the combobox only prompts me the first
time I click it, not subsequent times.
Why I think this happened: I used Parameter in my query
and not input box
What I've tried: assigning an input box output to
a "dim variable name as date" in Gotfocus or Click, but to
no avail
Current Code: in the rowsource of the combox is this
query:
Parameters(beginningDate]DateTime;
Select table.ID, table.yada
from table
where(
(table.xdate>=beginningdate And
table.xdate<=(beginningdate+1)
))
Order by table.ID
In code I have:
Private sub comboselectdate_Afterupdate()
Dim rs as DAO.recordset
Set rs = Me.RecordsetClone
With rs
..Findfirst "ID = " & Me.Comboselectdate
..Edit 'Mode
!Combodate = Date
..Update
Me.Bookmark = .Bookmark
End With
Me.Combo39.Requery
Me.Combo43.Requery
End Sub
This all does prompt me for a date, select table records
for the date, list the date in the combobox, and if I
select one of those records in the list, that record
appears in Combobox39 and Combobox43 as I want.
But again, if I go to select a different date, it does not
prompt me for a date again, it just uses the first date
originally input.