Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy one field to another

Status
Not open for further replies.

pwaterma

IS-IT--Management
Oct 24, 2006
5
US
i have a field called Amount Due and Amount Paid

I want to hit a button and copy the value in Amount Due to Amount Paid. I tried this

Private Sub Command16_Click()
Me!amountDue.SetFocus
DoCmd.RunCommand acCmdCopy
Me!amountPaid.SetFocus
DoCmd.RunCommand acCmdPaste

i get an error that command or action Paste is not available now. Is that because it is not acutally copying the amountDue first?

 
Whatever the reason for the error it would be simpler to do this:

me![amountPaid] = Me![amountDue]
 
sorry, should have been more specific
i using a Tabular form that is using a query so it lists a bunch of records.

each records has the amoundue and amount paid.
on the form I put the button between the two.
I am getting an error because the button is repeated on each row.

any idea how I can get around this.

 
Put the button on the same row as the two fields in your continuous form...

--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top