Combos show current when form opens

C

chopper7898

I have a form that uses cascading combo to find the records.
I used Mr. Allenbrowns code to open the database to the last record worked on
when it's closed and it works fine.
http://members.iinet.net.au/~allenbrowne/ser-18.html

What I need is to have the cascading combos show the current when it opens.

Presently when the database first opens they are blank.
How do I set them to show the current when the database if fist opened.
 
P

Piet Linden

I have a form that uses cascading combo to find the records.
I used Mr. Allenbrowns code to open the database to the last record worked on
when it's closed and it works fine.http://members.iinet.net.au/~allenbrowne/ser-18.html

What I need is to have the cascading combos show the current when it opens.

Presently when the database first opens they are blank.
How do I set them to show the current when the database if fist opened.

You would have to set the value in the open event. Sounds like
they're not bound, so you have to get the values and then write
them... should be able to do it with me.recordsetclone or
me.controlName...
 
C

chopper7898 via AccessMonster.com

Hi Piet, thanks for the response.
I have in the open event the following:

Fisrt combo:
Me.cboOrderByStatus = Me.Status
first combo column count is 1

Second combo:
Me.cboSelectMyProject = Me.cboSelectMyProject
second combo column count is 3

The First combo works but not the second.
Second combo is dependent on the selection from the first.

Below is what I have in the combo's events
__________________________________________________
Private Sub cboOrderByStatus_AfterUpdate()
Me.cboSelectMyProject = Null
Me.cboSelectMyProject.Requery
Forms!frm_MainForm.Refresh
Me.cboSelectMyProject = Me.cboSelectMyProject.Column(0, 0)
Dim Rst As DAO.Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ProjectID] = " & Me!cboSelectMyProject
Me.Bookmark = Rst.Bookmark
Rst.Close
Set Rst = Nothing
End Sub
_____________________________________________________
Private Sub cboSelectMyProject_AfterUpdate()
Dim Rst As DAO.Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ProjectID] = " & Me!cboSelectMyProject
Me.Bookmark = Rst.Bookmark
Rst.Close
Set Rst = Nothing
End Sub
_____________________________________________________

I have tried to fix this some time ago, with no luck.
Thanks.


Piet said:
I have a form that uses cascading combo to find the records.
I used Mr. Allenbrowns code to open the database to the last record worked on
[quoted text clipped - 4 lines]
Presently when the database first opens they are blank.
How do I set them to show the current when the database if fist opened.

You would have to set the value in the open event. Sounds like
they're not bound, so you have to get the values and then write
them... should be able to do it with me.recordsetclone or
me.controlName...
 
Top