I am having a difficult time getting started with this report I am trying to create. I am fairly new at programming and any help anyone can give me would be greatly appreciated.
I want to match records from TBL-CastProduction to TBL-ProdScrap by Casting PN.I think I need to use an if...then but i cannot get it to work right. If there is a matching CastingPN then I want to edit TBL-ProdScrap to update certain fields (ex. CastGood) with certain fields from TBL-CastProductin (ex. Shots). If there is not a matching record then I want to add the record to TBL-ProdScrap.
Dim rstCastProd As Recordset
Dim rstProdScrap As Recordset
Dim SQL As Variant
Dim db As Database
Dim strTable1 As String
Dim strTable2 As String
strTable1 = "TBL-ProdScrap"
strTable2 = "TBL-CastProduction"
Set db = CurrentDb
Set rstProdScrap = CurrentDb.OpenRecordset(strTable1, dbOpenDynaset)
Set rstCastProd = CurrentDb.OpenRecordset(strTable2, dbOpenDynaset)
This is as fasr as I have gotten. Everything I try does not work.
I want to match records from TBL-CastProduction to TBL-ProdScrap by Casting PN.I think I need to use an if...then but i cannot get it to work right. If there is a matching CastingPN then I want to edit TBL-ProdScrap to update certain fields (ex. CastGood) with certain fields from TBL-CastProductin (ex. Shots). If there is not a matching record then I want to add the record to TBL-ProdScrap.
Dim rstCastProd As Recordset
Dim rstProdScrap As Recordset
Dim SQL As Variant
Dim db As Database
Dim strTable1 As String
Dim strTable2 As String
strTable1 = "TBL-ProdScrap"
strTable2 = "TBL-CastProduction"
Set db = CurrentDb
Set rstProdScrap = CurrentDb.OpenRecordset(strTable1, dbOpenDynaset)
Set rstCastProd = CurrentDb.OpenRecordset(strTable2, dbOpenDynaset)
This is as fasr as I have gotten. Everything I try does not work.