Updating info in a suform, using another popout suborm.... (1 Viewer)

bobunknown

Registered User.
Local time
Today, 05:42
Joined
May 25, 2018
Messages
77
Hi all its me again.

Before posting this I have done a good bit of reading on the issue, even looking in to some of the older posts on this site but nothing seems to work this far.
(Namely these posts/sites: https://access-programmers.co.uk/forums/showthread.php?t=195350

http://access.mvps.org/access/forms/frm0031.htm)

To save confusion on the issue (as is the case with many of my posts) there is a blank copy of my database for people to tinker with.
View attachment Test Database - Blank.accdb

Open the Trade_Waste_Address form to get started (Main form)

In it you'll find one record named test.
The issue im having is to do with the bottom centre sub form "Bins" the columns in it are self explanatory and the ones im looking at most of all are "Bin Cost" and "Collection Cost".

To get these two fields to update with new prices at the start of every year I have created a second popout subform with all the pricing data contained in the table "Bin Pricing" and opened by pressing the button "prices" just above the Bins subform.

Upon pressing you will see the popout form appear, with the idea being that should I want to change my prices I simply alter them in this form, press the button at the bottom and it should change all the existing records in the databse... This dose not happen however.

I believe the problem might be with few lines of code I have written for the text boxes, "Bin Cost" and "Collection Cost":

Code:
Private Sub Bin_Cost_Click()
Me.Bin_Cost = Me.Combo31.Column(1)
End Sub
Code:
Private Sub Colection_Cost_Click()
Me.Colection_Cost = Me.Combo31.Column(2)
End Sub
The above code works as you can see if you try make some new bin entries but even after adding a Sub for refreshing the bins form on start up the data wont update after a change is made to my "Bin Pricing" sub form.

Hopefully one of you gurus can help me along.

Thanks in advanced.
 

bobunknown

Registered User.
Local time
Today, 05:42
Joined
May 25, 2018
Messages
77
Solved for any interested:

The issue was with my structure. All the info I needed was there it just wasn't structured right and I was trying to use VBA to get around the issue.

I have since restructured my database so that my Pricing popout shares a relationship with my Bin's subform directly linked to the Bin Size ID. This results in any changes to the Bin Size ID's price in the popout form instantly being filtered in to the rest of the database.
 

Users who are viewing this thread

Top Bottom