Topics Search

MS 2010 Forms - Creating Recordset

MS 2010 Forms - Creating Recordset
Views: 33
I am very new to MS Access 2010 Forms. I was working on 2003 before.
I am using the below code to read the table but it's not working. Can somone plz send me the code should I use in 2010?

Dim Dbs As Database
Dim rs As Recordset
Dim X As Double

Set Dbs = CurrentDb
Set rs = Dbs.OpenRecordset("[2b - 2010 Campaign Details]")

AA = "00100000002ta6TAAQ"
Do While Not rs.EOF
If AA = rs!AccountId Then
MsgBox ("Got it!")

End If
Sponsored Links:

More topics


Creating an updatable query recordset using Access 2010

I am trying to create a recordset in Access 2010 using a query. The query uses global variable that captures the users log-name to filter for the records that they entered. The queryexecutes, but the records are not updatable.

The code uses ADO. My goal is to split this database to create a multi-user environment. The source table has a primary key and there are no calculated fields.

Can someone please explain how I can make this recordset updatable.

Form Recordset Property (Want ADODB.Recordset for MDB Forms)

In Access 2002/2003, is it possible to get the forms in a MDB front end to use ADO Recordset's for their Recordset property instead of (I guess?) DAO Recordsets? I want to do this for compatiblity with an access data project which uses ADODB.Recordset for it's Form Recordset property by default.

form controls & recordset

I am creating an access app where I have 2 forms.

Default Form with combobox cb_default

Main Form with combobox cb_Main and a listbox lst_main

I have bound the Default form to a recordset and retrived a column of the table into cb_Default.I want to populate the cb_Main from the same recordset according to the value selected in cb_Default and populate lst_main from the same recordset accoording to value selected in cb_main.

Do I have to bind the recordset to each control because the query is not same for all

I am little confused

Recordset get records from Recordset

trying to open a recordset from a select statement off of another recordset. access can't find the input table or query.

Is it not possible to open a recordset off the results of a prior opened recordset

Access 2010 Formatting Forms

After creating a form, you might want to modify its appearance. Formatting your forms can help make your database look consistent and professional. Some formatting changes can even make your forms easier to use. With Access 2010's formatting tools, you can customize your forms to look exactly the way you want.
In this lesson, you will learn how to add command buttons, modify form layouts, add logos and other images, in addition to changing form colors and fonts.

EOF to gray out nextButton

What is wrong about this:?

Private Sub Form_Current()
Forms!A.btnNext.Enabled = (Not Forms!A.Recordset.EOF) End Sub

There is a Form "A" and a button "btnNext" on it. onCurrent I'd like to gray or not to gray it out depending on whether the last record has been reached or not.

What is wrong about the code above? It doesn't work.
Forms!A.Recordset.EOF seems to return only FALSE (even at end of RecordSet

filter a recordset

I am trying to filter a recordset but it doesn't seem to be working.

The forms recordset has 3 rows. One of the fields is a status flag. I want to only show the rows in my recordset where the StatusFlag is empty ("").

I use the filter but when I do a row count I still get 3 rows

Set rs = srcForm.Recordset
rs.Filter = "StatusFlag = """""
MsgBox rs.RecordCount


I would like to move to record number x in a recordset using

me.recordset.move x, 1

However, I keep getting a "not a valid bookmark" error.

What am I missing? Does the form's recordset object take different methods to an ADO recordset?

Of course, I can achieve the same effect using:

me.recordset.move x

but that doesn't help me to understand why I can't get .move to work with two parameters

Save Form In PDF Format

Unlike previous versions, Access 2010 offers a direct way to publish reports and forms in widely used document publishing format – PDF. Once you’ve done creating your forms in Access 2010, you can export the form into PDF and XPS format

DAO.Recordset Vs ADODB.Recordset Vs Recordset

So I know that there are two types of libraries for retrieving recordsets, either DAO or ADO.
I read somewhere that if you are using DAO, you should use DAO.recordset instead of just "recordset" to make sure it run properly.
Dim rs As DAO.Recordset
instead of
Dim rs As Recordset

but if the default is DAO anyways (I think), would it really cause any problems. (I'm using Access 2003)

So now, which is better DAO or ADO if I'm only using a recordset to update a single field of a record from a table that may contain hundreds of records.

Which is better in general? What exceptions are there? What do other people use