Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to save just a few fileds from a data entry form?

Status
Not open for further replies.

madu

IS-IT--Management
Feb 20, 2002
11
US
Hello,
I want to know whether it is possible to save just a few fields from a data entry form and to display the remaining?
Details:
I have a mian data entry form which contains COMPID.Also, from that form I can open several other data entry forms which also contain the COMPID(since I am linking all the forms using COMPID).Now when I enter data to the main form and save it, it saves the COMPID and when I go to the other forms and enter data and try to save it it gives me error,index or primary key is duplicate.I know why it is doing it,Since COMPID is already saved from teh main form it is not goign to acccept the same id,but I want to save other information tot eh same COMPID record using the other forms.So I want to knwo whether it is possible to save other info leavign the COMPID in the forms I open using buttons,I am not good at writing code,so if anyone has soem idea please help me out.I am saving the records using the SAVE button created using teh wizard.So can I change that code so that it doesn't save all the fields??
Thanks,
Madu.
 
Hi Madu,

I'm not an expert or anything and I don't know what COMPID means, but you can control what data is saved from a form by putting some code like the following in the click event of the 'save' button

Dim dbs as database
Dim rstSave as RecordSet

set dbs = currentDb
Set rstSAve = dbs.OpenRecordSet('SQL for table')

rstSave.edit
rstSave(" 'field name ") = 'control on form
rstSave.Update

Just put a line in the edit part for each field you want to save and it's corresponding control on the input form.

Hope that makes sense and helps a little...


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top