Record selection in a continuous form.

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

Guest

Hi all

I have a continuous form. I like to be able to mark/select one or more records from the form and then export it to a new MDB. Is this possible? Examples if possible. Thanks in advance.
 
To be able to select multiple non-contiguous records, you need to have a
yes/no field in your table, so the user can simply check the box for the
records they want.

Then Execute an Append query statement to perform the export:
strSQL = "INSERT ...
dbEngine(0)(0).Execute strSql, dbFailOnError

To get an example of the query statement you need:
1. Create a new query into the source table, and drag the fields into the
grid.

2. Enter True in the Criteria row under your Yes/No field (so only selected
records get exported).

3. Change it to an Append query: Append on Query menu.
Access asks for the table to append to.
You can select the MDB file and the table name.

4. Swith the query to SQL view (View menu) and copy what you see there.

To deselect the yes/no field for all records again:
strSQL = "UPDATE MyTable SET MyYesNoField = False WHER MyYesNoField =
True;"
dbEngine(0)(0).Execute strSql, dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Harry said:
I have a continuous form. I like to be able to mark/select one or more
records from the form and then export it to a new MDB. Is this possible?
Examples if possible. Thanks in advance.
 
Back
Top