vba select field

  • Thread starter Thread starter remigio
  • Start date Start date
R

remigio

Hi,
having a button on a form, is it possible to select only some fields
(all from the same table) of the current record instead of all fields?
I've tried this code:

RunCommand acCmdSelectRecord
RunCommand acCmdCopy
Forse dipende dei dati nel record.

but it selects ALL fields in the form.
Thank you.

Remigio
 
hi,

having a button on a form, is it possible to select only some fields
(all from the same table) of the current record instead of all fields?
I've tried this code:

RunCommand acCmdSelectRecord
RunCommand acCmdCopy
Forse dipende dei dati nel record.

but it selects ALL fields in the form.
Yes, you need to run an append query. Create one with the query designer:
Add your table where your form is based on. Change the query type to an
append query. Select the fields you only want to append. Add the primary
key field and add a condition to it. Use the wizard to build a form
reference to your current form.

http://office.microsoft.com/en-us/access/HA100765271033.aspx

Store the query. You can then run it using

DoCmd.RunQuery "yourQuery"


mfG
--> stefan <--
 
....
Add the primary
key field and add a condition to it.

What type of condition?

Use the wizard to build a form
reference to your current form.

A form reference? May you explain to me how to operate?

In substance II have to subsitute the posted code with your

DoCmd.RunQuery "yourQuery"

is it correct?

Thank you very much.

Remigio
 
Have you read the links (also Tom's) and tried the examples?

Yes, I have.
I'm also able to create and run an update query (it seems this the
article referres).
I only please you to explain me what "... and add a condition to it.
Use the wizard to build a form
reference to your current form. " means, maybe with an example.
Thank you very much for help.

Remigio
 
Back
Top