Link to home
Start Free TrialLog in
Avatar of WS
WSFlag for United Arab Emirates

asked on

MS Access - Form - Open new form with previous form IF for Edit Record

Hey,

I have a form in which user search for record, this form have a subform which is a datasheet  in which the required search show up. Then there is a button as Edit Record which open new form for editing. I have 9 fields in subform, when user select record and click edit button the new form which open up shows the previous 8 fields except one field "ID" which is always opening as a new record, i want the ID to be  from the previous form not the new record. I have set Data Entry to be Yes which is required in my form, is there a way to get ID from previous form with data entry to yes.

Any help would be appreciated.

Thank you.
SOLUTION
Avatar of Anders Ebro (Microsoft MVP)
Anders Ebro (Microsoft MVP)
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WS

ASKER

It's not working, any idea why? still it show id as new .
If it shows ID as new, it is because the field is bound to an AUTONUMBER field, where you can't assign ID's through the GUI interface.
Avatar of WS

ASKER

yes it is an autonumber field , isn't it possible through VBA? what if i put Data entry to no?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WS

ASKER

i just want to open it to Data Entry form so that i could get values for all the fields from previous form. I am using Default Value property for 8 fields and if i turn Data Entry to No it doesn't work. that's the only reason behind this.
Avatar of WS

ASKER

Thank you everyone :)

i turn off the Data Entry property and for ID i use the code mark as best solution with the rest field using Default Values from previous form.

Thanks again.
Humm.... Test that a bit to make sure it is really what you are looking for (I'm not 100% clear on your goal here).  If you are actually trying to 'Copy an existing record to a new record', there are plenty of examples on the web.  If you still need assistance, you can use the 'report question' button to ask a moderator to reopen the question.