mysql - Use text from record to paste into an Access form controlbox -


based on user's job id number, create recordset of id different unit types (think pipe sizes) , unit (think footage of pipe). each unit type record has name of form textbox total footage goes in different column. want go through each recordset , plugin footage each unit type job id number (that user puts in form).

dim rst_unitentrycounts recordset    set rst_unitentrycounts = currentdb.openrecordset("select tbl_unittypes.unittypes_weeklytextboxuserentryform, " _                                                         & "             tbl_pmentry.pmentry_week_ending, " _                                                         & "             tbl_unittypes.unittypes_cumalativetextboxuserentryform, " _                                                         & "             sum(tbl_unitentry.unitentry_unit_count) sumofunitentry_unit_count " _                                                         & "from tbl_unittypes " _                                                         & "         inner join tbl_unitentry on tbl_unittypes.unittypes_id = tbl_unitentry.unitentry_unittypes_id) " _                                                         & "         inner join (tbl_pmheader " _                                                         & "         inner join tbl_pmentry on tbl_pmheader.pmheader_id = tbl_pmentry.pmentry_pmheader_id) on tbl_unitentry.unitentry_pmentry_id = tbl_pmentry.pmentry_pmheader_id " _                                                         & "where tbl_pmheader.pmheader_id = " & num_pm _                                                         & "group tbl_unittypes.unittypes_weeklytextboxuserentryform, " _                                                         & "             tbl_pmentry.pmentry_week_ending, " _                                                         & "             tbl_unittypes.unittypes_cumalativetextboxuserentryform ")             rst_unitentrycounts.movefirst             until rst_unitentrycounts.eof = true                 [rst_unitentrycounts.unittypes_weeklytextboxuserentryform] = sumofunitentry_unit_count             rst_unitentrycounts.movenext             loop     exit sub 

image of query table looks like also, im getting error 3131 syntax error in clause well. in advance!

finally figured out how "place" value (sum of units) in textbox varies based on criteria (unit type) in form, name of textbox inside record within recordset. in case else has similar question, here how did it:

dim cntl string  dim frm string  dim rst_unitentry recordset  frm = "frm_userentry"  set rst_unitentrycounts = currentdb.openrecordset("select...)      if rst_unitentrycounts.recordcount <> 0         rst_unitentrycounts.movefirst         until rst_unitentrycounts.eof = true         if rst_unitentrycounts![unittypes_cumalativetextboxuserentryform] <> ""             cntl = rst_unitentrycounts![unittypes_cumalativetextboxuserentryform]             forms(frm).controls(cntl) = rst_unitentrycounts![sumofunitentry_unit_count]         end if         rst_unitentrycounts.movenext         loop 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -