auto fill

khurram7x

Registered User.
Local time
Tomorrow, 04:00
Joined
Mar 4, 2015
Messages
226
How to fill values in a new record with data from previous record please?

I've total 11 columns in a table and values in 3 4 columns are repeating for few rows before it needs to be changed eventually. I want to fill these rows with values from previous record.

Thanks.
 
I've total 11 columns in a table and values in 3 4 columns are repeating for few rows before it needs to be changed eventually.

What are these values representing?

Maybe these values should be stored in a related table and just the ID of those records put in the main table?
 
Maybe these values should be stored in a related table and just the ID of those records put in the main table?
You're right Galaxiom, but it was my first database project and there are design limitations. At the moment, am just looking for workarounds so that I learn more and more. Thank you so much.

Got it working, thank you once again )

Just couple of questions please.

1. Like you mentioned the link. In first line, why there are couple quotes inside another couple quotes please?
const cQuote="""" 'Thats two quotes
me!Control.DefaultValue = cQuote & me!Control.Value & cQuote
I tried to work with 1, 2 and 3 quotes and it also works fine. I'm not understanding the behavior.

2. Now I've again done this with the combination of VBA and Macro. I'm calling Macro from VBA just to run the GoToRecord Macro because I'm constantly failing to call GoToRecord from VBA... here's how I've tried in VBA:
DoCmd.GoToRecord acDataForm, frmClient, acGoTo, 3
DoCmd.GoToRecord acDataForm,frmClient,acLast,
I've even tried without ',' after acLast in the last command but could get it work!!

When I execute I get the error 'Identifier under cursor is not recognized'. Spelling, identifier... everything is correct. Then why is it so please?

Thank you.
 
The name of the form must be in quotes.
 
The name of the form must be in quotes.
Thanks, and what is the correct format for DoCmd.GoToRecord
acDataForm, frmClient, acGoTo, 3
DoCmd.GoToRecord acDataForm,frmClient,acLast,
I've even tried without ',' after acLast in the last command but could get it work!!
 
Thank you. Sorry for late reply.

Provided link shows, DoCmd.GoToRecord acDataForm, "Employees", acGoTo, 7 while I'm looking for a correct format of go to last record, i.e. DoCmd.GoToRecord acDataForm,frmClient,acLast,
for Access 2010.

K

I have just used
Code:
DoCmd.GoToRecord acDataForm, "TestTransactions1", acLast

in a form in 2003 and that works fine.?

The wizard actually generates
Code:
DoCmd.GoToRecord , , acLast
if it is the same form.
 
I have just used
Code:
DoCmd.GoToRecord acDataForm, "TestTransactions1", acLast
in a form in 2003 and that works fine.?

The wizard actually generates
Code:
DoCmd.GoToRecord , , acLast
if it is the same form.

Thank you. Works now, I was missing the double quote marks in the form name portion of the code.

Though I tried 'DoCmd.GoToRecord , , acLast' in my code earlier, but it didn't work... but now it is working. I'm using Access 2010.

Sometimes closing and reopening Access solves these kind of problems, sometimes after restart. Don't know why it happens at all!!
 
Thank you. Works now, I was missing the double quote marks in the form name portion of the code.

Though I tried 'DoCmd.GoToRecord , , acLast' in my code earlier, but it didn't work... but now it is working. I'm using Access 2010.

Sometimes closing and reopening Access solves these kind of problems, sometimes after restart. Don't know why it happens at all!!

I did emphasise that in post #7. :D
 

Users who are viewing this thread

Back
Top Bottom