vba select field

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
 
S

Stefan Hoffmann

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 <--
 
R

remigio

....
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
 
S

Stefan Hoffmann

hi Remigio,

Add the primary
What type of condition?
Use the wizard to build a form
A form reference? May you explain to me how to operate?
Have you read the links (also Tom's) and tried the examples?


mfG
--> stefan <--
 
R

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top