Duplicating only Certain Fields in a record (1 Viewer)

mkdrep

Registered User.
Local time
Today, 11:42
Joined
Feb 6, 2014
Messages
176
I created a button in a form that duplicates the record so our employees can fill in the form more quickly.

I know I am being greedy, but is there someway to change the VBC so I only duplicate certain fields in a record, not all of them?

I have attached a (.jpg) of the Duplicate record code that is automatically created by Access when you use the "Duplicate record" option when making up a button on a form. I have attached a 2nd (.jpg) which shows the (7) fields I want to duplicate, out of the (20) available fields for each record.

Thanks in advance for the help. Mark
 

Attachments

  • Dup-Record-Code.jpg
    Dup-Record-Code.jpg
    32.6 KB · Views: 146
  • Dup-Record-Fields.jpg
    Dup-Record-Fields.jpg
    7.8 KB · Views: 116

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:42
Joined
Aug 30, 2003
Messages
36,118
Presuming you're on the record, copy the desired field data into variables, use GoToRecord to go to a new record, then use the variables to populate the same fields.
 

mkdrep

Registered User.
Local time
Today, 11:42
Joined
Feb 6, 2014
Messages
176
Thank you for your reply, Paul.
The personnel that use my program aren't computer savy enough to do what you have described above. I was hoping to modify the Visual Basic Code as shown in attached (dup-record-code.jpg) to enable only a few of the fields to be duplicated into a new record.

If found a solution presented on this forum back in 7-20-2007, per attached (dup-record-7-20-2007.jpg) but didn't know if I could edit the VBC in a similar fashion to accomplish what I am trying to do.....
Thanks...Mark
 

Attachments

  • Dup-Record-7-20-2007-solution.jpg
    Dup-Record-7-20-2007-solution.jpg
    93.9 KB · Views: 123

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:42
Joined
Aug 30, 2003
Messages
36,118
I wouldn't expect them to do it; that's our job as developers. You should be able to use variables as I described in the code posted. Before the line that goes to a new record, you copy data from the desired fields into variables, go to a new record, and copy them back from the variables instead of the recordset.
 

mkdrep

Registered User.
Local time
Today, 11:42
Joined
Feb 6, 2014
Messages
176
I wouldn't expect them to do it; that's our job as developers. You should be able to use variables as I described in the code posted. Before the line that goes to a new record, you copy data from the desired fields into variables, go to a new record, and copy them back from the variables instead of the recordset.

Paul: IMO, I am really not a developer. I've written an access program for my business but I don't know 95% of the "tricks" that a developer would. I don't know the first thing about "variables"....is there a link you could send me that I could use to start some research on "variables"? Thank you.
Mark
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:42
Joined
Aug 30, 2003
Messages
36,118
Along the lines of:

Code:
Dim VariableName As String '(or Long, etc.  appropriate data type to match the field)

VariableName = Me.Whatever
DoCmd.GoToRecord , , acNewRec
Me.Whatever = VariableName

Is that a commercial link or for SEO? If so, could you remove it please.
 

mkdrep

Registered User.
Local time
Today, 11:42
Joined
Feb 6, 2014
Messages
176
Along the lines of:

Code:
Dim VariableName As String '(or Long, etc.  appropriate data type to match the field)

VariableName = Me.Whatever
DoCmd.GoToRecord , , acNewRec
Me.Whatever = VariableName
Is that a commercial link or for SEO? If so, could you remove it please.

Thank you for the help, Paul.

The link I posted is to help raise money for a 28 year old man who has had ALS for 5 years and is dealing with staggering medical bills.... don't even know what you are referring to when you mention a "SEO".

I'll remove the link .........thanks again for your help.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:42
Joined
Aug 30, 2003
Messages
36,118
No problem, post back if you get stuck. I don't have a problem with a link like that. SEO is search engine optimization. We get spammers here all the time that try to post links to "www.xyz.com" because search engines will see the link and boost xyz.com up their ratings.
 

mkdrep

Registered User.
Local time
Today, 11:42
Joined
Feb 6, 2014
Messages
176
No problem, post back if you get stuck. I don't have a problem with a link like that. SEO is search engine optimization. We get spammers here all the time that try to post links to "www.xyz.com" because search engines will see the link and boost xyz.com up their ratings.

Thanks for the reply, Paul. I can certainly understand your concern about spamming issues! :mad:

Thank you for letting me post this link and thank you again for the help! :)

www.gofundme.com/i4jo4c
 

ansentry

Access amateur
Local time
Tomorrow, 02:42
Joined
Jun 1, 2003
Messages
995
MKDREP,

Have a look at this very OLD example of mine, it may be of help.

Link Here
 

Users who are viewing this thread

Top Bottom