469,315 Members | 1,569 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

What is the alternative to copy/paste function available in Access 2003 not in 2007?

My purchase order system sequentially added the next number to the new order when I clicked the macro button set up with copy/paste functions and it worked well. I cannot do this now as 2007 does not offer these macro functions.

My system simply looked at the last record copied the number in the field - opened a new record and pasted the number+1.

I cannot use the autonumber function because if a record is raised and then not proceeded with I will have a missing number in the audit trail. The trail must be sequential with no missing numbers.

I am a self taught ( I think they call it discovery learning) Access user and could just do with a little (lot) bit of guidance here. Thanks in advance. Jock
Oct 7 '09 #1
5 3658
32,173 Expert Mod 16PB
Is it really a macro, or might it be running VBA code?

If it's code we can help you to resolve the issue. Unfortunately I cannot help with macros as I never use them. For help you would need to post what you have that's not working of course.
Oct 7 '09 #2
1,287 Expert 1GB
You might want to use DMax.
Oct 7 '09 #3
32,173 Expert Mod 16PB
That's certainly what I'd suggest Chip, but if he's restricted to using simple macros that won't be possible.
Oct 7 '09 #4
Thanks, I was wondering if there was an event procedure script using the DoComd function that would successfully do a cut/paste and increment the pasted number by one.

I need to keep it simple as my access knowledge level is limited.
Oct 7 '09 #5
32,173 Expert Mod 16PB
To be fair Jock, I doubt that would even suit your needs well.

What you need to do (we can help if you post enough detail) is to add one to the maximum value already held in the table for that field. This is what Chip was referring to in his post #3. It's certainly the way to go I would say.

Copying and pasting is possible (I use Copying in a database I designed for storing common posts for Bytes) but I can't think it would be appropriate here.

I'll include a doctored version of the procedure here in case it's of any use :
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtCopy_Click()
  2.     With Me.txtCopy
  3.         Call .SetFocus
  4.         .SelStart = 0
  5.         .SelLength = Len(.Value)
  6.         Call DoCmd.RunCommand(Command:=acCmdCopy)
  7.     End With
  8. End Sub
Of course, even in this case, were you intending to add 1 to the current value of a control you're better off simply saying :
Expand|Select|Wrap|Line Numbers
  1. DestControl = Me.SourceControl + 1
in your code instead. This is bound to cause you problems eventually though. Use DMax() is the only sensible suggestion.
Oct 7 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

121 posts views Thread by typingcat | last post: by
1 post views Thread by Steve | last post: by
1 post views Thread by rummey | last post: by
3 posts views Thread by Sebastian C. | last post: by
13 posts views Thread by John | last post: by
6 posts views Thread by Donald Grove | last post: by
1 post views Thread by christianlott1 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.