Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access vba combo box

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Access VBA Combo Box

Access VBA Combo Box

ResolvedVersion 2003

Nicola has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

Access VBA Combo Box

I am trying to duplicate a box used on an old database within a new one and I have set all the parameters to be the same, size etc, but when I try to use the combo box on the form in form view I get the following message:

The record source '~sq_cfrm:PartOne~sq_cCombo46' specified on this form or report does not exist

You misspelled the name, or it was deleted or renamed in the current database, or it exists in a different database.

In the Form or Report's Design view, display the property sheet by clicking the Properties button, and then set the RecordSource property to an existing table or query.


When I check this it gives me the correct link to the frm:Searches and when I Debug it has the following code:

Sub Combo46_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[NYCCID] = " & Me![Combo46]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Maybe I am just being stupid but nowhere in my old database was there a recordset called Clone and I cannot work out why it would think there is. Is the use of Clone as a recordset something that I should remember from my training?

Thanks

Nikki

RE: Access VBA Combo Box

Hi Nicola

Thanks for your question

RecordsetClone is a property that refers to a copy of the table or query underlying a form. It can be used to to work with the data viewed from a form independently of the form itself.

We do not use this method on the VBA course. We instead use DAO objects to achieve the same aim.

I suggest you try adopting that code here.

If you have any other questions, or need some further pointers please do get back to me

Regards

Stephen

RE: Access VBA Combo Box

Stephen,

I will have a look at trying that tomorrow, but have put it down for today in case I punch my screen!

Thanks Very Much

Nikki

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Closing form after a certain time period

To make a form close automatically after a certain time period, you need to assign the close function to a macro.

Save the macro and ope up the form in design view. open the Properties sheet.

In the TimerInterval property enter the length of time you want the form open for. This should be in milliseconds, so for instance if you want the form open for 5 seconds enter 5000, for an minute enter 60000.

You now need to attach your macro (to execute the Close action) to the OnTimer event property of the form.



View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.