Update/Edit/Save some of the data into table from Form (1 Viewer)

meiteniite89

New member
Local time
Today, 17:47
Joined
Aug 13, 2020
Messages
23
Hello,

I have created a form called Update info, see attached file.
Majority of this information is stored in table ALLGaugeDB, but Area, Location, Location Name and Location Code are stored in second table AREA.
Data is linked using Location Code (that is on both tables).
Area/Location/Location Name/ Location Code are used as combo boxes based on previous choice list in next one changes.

My question is how after updating all or some information do I get to save info only in ALLGaugDB and not change anything in table AREA? Right now every time I change Area/Location/Location Name/Location Code it creates new entry in AREA table with this info.
If I lock table AREA or combo boxes, I can't save any of this info.

Please note: table AREA is fixed and no new entries are added to it.

Thank you
 

Attachments

  • Capture.JPG
    Capture.JPG
    35.4 KB · Views: 29

arnelgp

error reading drive A:
Local time
Tomorrow, 01:47
Joined
May 7, 2009
Messages
11,130
are you using Joined Query.
if so remove Area table from it.
or make those textbox (for area) unbound and use Dlookup()
to fetch them.
 

meiteniite89

New member
Local time
Today, 17:47
Joined
Aug 13, 2020
Messages
23
are you using Joined Query.
if so remove Area table from it.
or make those textbox (for area) unbound and use Dlookup()
to fetch them.

Is there any other way?
I am using SELECT DISTINCT on them combo boxes, so it filters it based on previous selection and when I open info up, so it shows me the info in them otherwise they stay blank if they are unbound.

Can Save button command be modified to only save info to table ALLGaugeDB and not to AREA?
 

arnelgp

error reading drive A:
Local time
Tomorrow, 01:47
Joined
May 7, 2009
Messages
11,130
so you have a Cascading combo there?
make those unbound and add a code to each combos
after update to get the Unique LocationID of those area,location, locationname, locationcode.
this LocationID is the one you will save to table AllGuageDB.
 

meiteniite89

New member
Local time
Today, 17:47
Joined
Aug 13, 2020
Messages
23
so you have a Cascading combo there?
make those unbound and add a code to each combos
after update to get the Unique LocationID of those area,location, locationname, locationcode.
this LocationID is the one you will save to table AllGuageDB.

yes, but I have no idea how to do it any different way

when I change them to unbound, it works, but doesn't display them when I open this form

any idea how I can get them to be displayed?
 

Attachments

  • Capture2.JPG
    Capture2.JPG
    35 KB · Views: 22

meiteniite89

New member
Local time
Today, 17:47
Joined
Aug 13, 2020
Messages
23
Update:

I changed Area, Location and Location Name to unbound. I have tried different ways of getting it to display info before update and it's not working. Can anyone advise on how to solve this?
 

arnelgp

error reading drive A:
Local time
Tomorrow, 01:47
Joined
May 7, 2009
Messages
11,130
upload your db so we can see your table structure.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:47
Joined
Feb 19, 2002
Messages
30,597
There is no need to make controls unbound and use dlookup()'s.

If you are using combos for some fields, there is no reason to include those tables in your query at all so just remove them and the combo will work just fine as long as it is bound to a field on the main table.

In a situation where you actually want to join to lookup tables in your query so you can show additional columns of data, make sure you set the locked property of the columns from the lookup table to yes to prevent accidental updates. For example, you have a combo that picks the customerID. It shows the customerName. If you want to show the address fields also, include a join to the customer table and select the additional fields.

Here's an example that you might find useful.
 

Attachments

  • FillFormFields20180816.zip
    342.4 KB · Views: 25

Users who are viewing this thread

Top Bottom