Selecting records

  • Thread starter Thread starter Michael Wong
  • Start date Start date
M

Michael Wong

Hi,
I would need some suggestions.
I don't know whether this is a good user interface design or not...

I would like to select some records to be printed.
For this, I have a Yes/No field for the records which, on a sub-datasheet, I
can click to select or unselect the records.
On the main form, I have a command to unselect, or select all the records.
The problem is, I'm not quite sure of how I can implement this: update
query, or using the recordset from the sub-datasheet?

Any suggestion?
 
Hi Michael,

I'd use a form to display the records and buttons, never a subdatasheet;
and update queries for Select All or Deselect All.
 
Hi John,

Thank you for your reply.
Actually, I'm already doing a filter on the subdatasheet:
mySubdatasheet.Form.RecordSource = rowSrc

I would like to try and use an update query, but am stuck of how I can only
apply the query to the data I have filtered.

Any hint would be much appreciated.

Thanks
 
It looks as if
rowSrc
is a variable containing a SQL statement or the name of a query. One
approach would be to use the WHERE clause from this in the update query.

Hi John,

Thank you for your reply.
Actually, I'm already doing a filter on the subdatasheet:
mySubdatasheet.Form.RecordSource = rowSrc

I would like to try and use an update query, but am stuck of how I can only
apply the query to the data I have filtered.

Any hint would be much appreciated.

Thanks
 
Yes, rowSrc is an SQL statement containing a WHERE clause.
I was just wondering how I can do the update without having the WHERE
clause.
Now, I'll just separate the WHERE clause from the SELECT statement and just
concatenate the two strings when needed.

Thanks a lot.

John Nurick said:
It looks as if
rowSrc
is a variable containing a SQL statement or the name of a query. One
approach would be to use the WHERE clause from this in the update query.
 
I have a problem...
The SQL statement is a select from a total Query, so I cannot modify the
data in there.
Any solution?

John Nurick said:
It looks as if
rowSrc
is a variable containing a SQL statement or the name of a query. One
approach would be to use the WHERE clause from this in the update query.
 
I don't understand. If you can edit the records in the subdatasheet,
surely the query it's based on is updatable.

I have a problem...
The SQL statement is a select from a total Query, so I cannot modify the
data in there.
Any solution?
 
No, the data in the subdatasheet is not editable. I only use it to display a
list of products satisfying certain conditions choosed by the user. To edit,
I would popup a form to edit the product (from its ProductId [PK]).

May be I should just go with the recordset in this case and update a
PrintField (Yes/No)...

John Nurick said:
I don't understand. If you can edit the records in the subdatasheet,
surely the query it's based on is updatable.
 
Back
Top