![]() ![]() ‘ refresh subform to display created sub batches ‘ save the record or else sub batches cannot be created ! NOTE MIGHT CAUSE ISSUES LATER IF WANT TO DELETE INCORRECT BATCHCODE ‘update the batch_code cell to display the new batchcode ![]() If BATCH_unique = “”empty”” Then original_ok = 1 If batchdd “””” Or batchmm “””” Or batchyy “””” Then TEMPbatchCODE = batchCODEB ‘Else MsgBox “”No data discovered””, vbOKOnlyīATCH_unique = Nz(DLookup(“”batch_code””, “”nm_inc_batchcodes””, “”batch_code=”” & “”‘TEMPbatchCODE'””), “”empty””) ‘ if any of the concenated date boxes are empty then If batchbox “””” Then TEMPbatchCODE = batchCODEA ‘ if batchbox is empty then use the value from the concenated date boxes LOCation_SUFfix = DLookup(“”LOCATION””, “”locations””, “”locationnumb=”” & DEFaultLOCation)īatchCODEA = PREFIXcode & “”_”” & batchbox & “”_”” & original & “”_”” & LOCation_SUFfixīatchCODEB = PREFIXcode & “”_”” & batchdd & batchmm & batchyy & “”L”” & batchlot & “”_”” & original & “”_”” & LOCation_SUFfix ‘ next we need to add a location suffix to the batch code so that it is fully unique this uses the users default location value PREFIXcode = DLookup(“”batch_prefix””, “”inc_categories””, “”cat_id=”” & ) ‘first lookup prefix code depending on which category it is in ‘ sets cycle to 0 and duplicate batchnumbers value to nothing If Batch_code “””” Then RunCommand acCmdSaveRecord ‘this might be a save so just check to see if a batchcode exists in the box ‘On Error GoTo err_btn_create_tests_Clickĭim rs As Recordset ‘ just a recordset used for cycling through and determining the spec – master – testĭim LOCation_SUFfix As String ‘ a string that adds a location suffix just in case 2 locations have the same primary batch numberĭim original As Integer ‘ a counter that cycles through suffix batch numbersĭim BATCH_unique As String ‘ a string that contains the current suggested batch nameĭim original_ok As Integer ‘ 1 or 0 dependant on if batch_unique is true There is a similar string later on, but because i need one to work before the other i have not been able to check if this has the same fault.Ĭhecking the code in debug mode Tempstring and me.batch_code definately contain values The line that seems to be causing me the issue is emboldened in the code below but here it is anywayĬurrentDb.Execute “”INSERT INTO nm_inc_batch_test_numbers(subbatchcode,batchcode) VALUES (‘”” & TEMPstring & “”‘, ‘”” & Me.Batch_code & “”‘)”” This was working fine purely in access, but now i am using access and sql i am having the “”Error 91 – Object variable or With block variable not set”” fault Thanks to people that have been helping with other parts of my database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |