Update query with form field

ootkhopdi

Registered User.
Local time
Tomorrow, 04:42
Joined
Oct 17, 2013
Messages
181
Hello

i have two tables
one is "empdata"
and other is "consolidate data"
In consolidate data ,i have all personal and salary data for one year of each employee
but i update some employee data in empdata
now i want to update each employee updated data to update in consolidate data.
i want to do it with update query which run with form,
is form i want create 2 combo box, 1st is employee name and 2nd is field name(which to be updated i.e. Date of birth)
now i have one text box (in which i enter the value for update in employee data i.e.04/05/1976(date of birth))
pls tell me how can i link this form to my update query as
1st combo box value is equal to creteria,
2nd combo box is equal to field in consolidate
and text box is value for updation...
pls help me..
if u can give pic also ..it will be more helpful to me.so i am too begginer and having short knowledge of access..

thanks in advance
 
Sorry - but you can't use dynamic field name in a query, you need some code for that.
Post a stripped version of your database with some sample date in it, (zip it). And of cause the name of the form in which you have the 2 combo boxes and the text control.
 
ok
i m attach my data and form

pls check and give me solution
 

Attachments

The solution is in the attached database.
 

Attachments

Dear JHB,,,
Thanks once again
as u provide me solution ..
can u give me full detail that how it works
as u set recordtype =7 or 10 ,what is the diffrence
so i can use it in other same problems
and i think ,now no use of update query in this code
so can i delete it..
pls
 
Dear JHB,,,
Thanks once again
as u provide me solution ..
can u give me full detail that how it works
as u set recordtype =7 or 10 ,what is the diffrence
so i can use it in other same problems
and i think ,now no use of update query in this code
so can i delete it..
pls
The explanation is in the code as comment.
Type = 7 Then it is a Number (Double) field type
Type = 8 Then it is a Date field type
Type = 10 Then it is a Text field type
Yes you can delete the update query.
Next time if you have some doubts, make a copy of your database, then you can make the changes and see if it works, if not then you've the copy to fall back on.
 

Users who are viewing this thread

Back
Top Bottom