How can you tell? What other difference is there between the two rows that
enable you to tell which record is which?
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hi Douglas,
Thank you for the code! I'm now only having one issue, when the "new"
record is created the userName on the "old" record and the "new" record
seem
to swtich. So now the original record shows the new userName and the
"new"
record shows the old userName.
Can someone tell me what I'm doing wrong?
Here's the code:
DoCmd.RunSQL "INSERT INTO tbl_MainBarcode_Single_new SELECT BarcodeID,
OfferDetail, DeliveryVehicle, DistArea, DistQty, DistStartDate,
DistEndDate,
ValidStartDate, ValidEndDate, ValidArea, NoteGeneral, Chain, DateAdded,
Cancelled, PromoCouponName, GroupRequesting, OfferType, Requester,
HurdleType, HurdleNumber, ProgrammedOrNot, RewardsOrNot, " & Chr(34) &
fOSUserName() & Chr(34) & " AS CreatedBy, MoreThan10stores FROM
tbl_MainBarcode_Single_new WHERE ([BarcodeID] =
Forms!frm_Entry_SingleItem.BarcodeID)"
Thank you!!!
--
dl
:
DoCmd.RunSQL "INSERT INTO tbl_MainBarcode_Single_new SELECT BarcodeID,
OfferDetail, ... " & Chr(34) & fOSUserName() & Chr(34) & " AS CreatedBy
FROM
tbl_MainBarcode_Single_new WHERE ([BarcodeID] = " &
Forms!frm_Entry_SingleItem.BarcodeID
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hi Jeff,
I've used your suggestions from this posting and they work
beautifully.
However, I've run into an issue; when someone copies a record
(here's my code for the copy)
DoCmd.RunSQL "INSERT INTO tbl_MainBarcode_Single_new SELECT BarcodeID,
OfferDetail, ... CreatedBy FROM tbl_MainBarcode_Single_new WHERE
([BarcodeID]
= Forms!frm_Entry_SingleItem.BarcodeID)"
...it copies the userName field as well, I'd like it to pull the
current
users network ID for the "new" record they've just created (via copy).
Any
guidance as to how I might accomplish this?
--
dl
:
What did you name the module itself?
It cannot be the name of any procedure or function.
Rename the module to something like basUserName.
Compile the code and then retest.
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html
in message:
Jeff,
Thanks for the help. I inserted the code in a new module and named
it
accordingly. To display the name captured, I setup a text box on
the
main
form with the control source as =fOSUserName() when I start the DB
is
get the
following in the box #Name? any suggestions?