Form Issue (1 Viewer)

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
Hi,
I want my subform to pull all the metrics from a table without me inputting it. e.g. in Capture1, date is 01/11//2018 you can see that Metric_ID's are filled 1-11 and I manually inputted them which pulls the relevant Metric_Name from a table.

But when I change the date to 02/11/2018 the subfrm doesn't show any metrics. I want the form to pull all the metrics from the relevant table so that I can fill in the Flag_ID's.

Any help is appreciated.

TY!
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    63.4 KB · Views: 57
  • Capture2.JPG
    Capture2.JPG
    50.8 KB · Views: 48

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:18
Joined
Aug 30, 2003
Messages
36,118
If I'm understanding correctly, you can execute an append query that gets the metrics from the relevant table and the date (plus anything else relevant) from the form.
 

Micron

AWF VIP
Local time
Yesterday, 20:18
Joined
Oct 20, 2018
Messages
3,476
Metric_ID's are filled 1-11 and I manually inputted them
Hmm. I interpret this as 2 other possibilities. If the subform and main form are bound, then the subform recordsource doesn't support the goal as it's not retrieving the metrics data because
I want my subform to pull all the metrics from a table without me inputting it
indicates to me that they are already there.


Or maybe the subform/main form isn't linked and the records aren't being retrieved based on a key field, which appears to be a date value. I've made the assumption that there are in fact, related records. Subform shouldn't need to be requeried if there is a working link between the two.
 

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
@pbaldy, just came back to my desk. I am going to try the append query and update.

@micron, frmMain & frmSub are related on the Driver_ID field not the Date field. Date field is actually an independent text box (format date) wgich is used to pull & store data into the metrics_details table.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:18
Joined
Aug 30, 2003
Messages
36,118
I would expect a relationship on both driver and date. Presumably a driver's entries for today will be independent from their entries for yesterday.

I was guessing your situation was similar to one I have, where limo drivers can have activity for multiple different rates during their shift. One option would be a subform where the user selects each used and fills in the hours, but the data entry people wanted it populated with all possible rates, then they just zip down the hours column (they're entering off of a printed sheet, head down). I prepopulate date/driver/rate with an append query so they can do that (later I delete any records with 0 hours).
 

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
@pbaldy attaching an image of the relationships.

yes the daily metrics will vary for the drivers. i haven't made a relationship on the date field but it is still working. I am using the Date field in the frmMain as a textbox and the frmMain & frmSub is correctly recording the metrics into the MetricsDetails table.
 

Attachments

  • Capture3.JPG
    Capture3.JPG
    38.2 KB · Views: 43

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
suggestion & question ... what if I use a query to run when the form loads ... ask the form to load the all the 11 Metric_ID's when it loads? is that a correct route to take?
 

Micron

AWF VIP
Local time
Yesterday, 20:18
Joined
Oct 20, 2018
Messages
3,476
apparently, you've elected not to receive pm's or you're too new. Likely the latter so I'm forced to use posting method. This isn't about your current thread, it's about living in the same city as you and your comment about collaboration. You can try pm'ing me I guess.
 

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
@micron yes I joined access forums UK only a few days ago and I can't send/receive any PM's. You can email me at rangerguy2000@yahoo.com.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:18
Joined
Aug 30, 2003
Messages
36,118
I'm not sure it makes sense when the form loads, as it needs to know the driver and date, doesn't it?
 

Rangerguy2000

New member
Local time
Yesterday, 17:18
Joined
Nov 19, 2018
Messages
8
OK now I am making some progress. So the ask is ..
- Input the Driver_ID and the Date into the mainFrm
- as soon as those are inputted the subFrm should load all the Metric_ID's and any relevant Flag_ID's if they exist in the table or not.

....
 

Users who are viewing this thread

Top Bottom