It is possible ... add this to code to the on click event of the form and rename the button to "save_button"...
Here is an example of how to enter data to the temp table.
I have given you an example of adding a new record if none were found and where the temp table record is edited to the new value.
Private Sub save_button_click()
On Error GoTo Err_save_button_click
Dim db As Database
Dim add_to_temp_tbl_qry As Recordset
Dim add_to_master_tbl_qry As Recordset
Dim unique_item_number As String
Set db = CurrentDb()
unique_item_number = Me.FormName.textboxname.Value
Set add_to_temp_tbl_qry = db.OpenRecordset("temp_tbl", dbOpenDynaset)
With add_to_temp_tbl_qry
If Not (.EOF And .BOF) Then
add_to_temp_tbl_qry.Index = add_to_temp_tbl_qry!temp_id
add_to_temp_tbl_qry.Seek "=", unique_item_number
If add_to_temp_tbl_qry.NoMatch Then
Debug.Print "No matches found in temp"
'if there are no results - do you want to add the record?
'add the item here
'add_to_temp_tbl_qry.AddNew
'add_to_temp_tbl_qry!temp_id = unique_item_number
'add_to_temp_tbl_qry.Update
Else
'has a record and update it
add_to_temp_tbl_qry.Edit
add_to_temp_tbl_qry!temp_id = unique_item_number
add_to_temp_tbl_qry.Update
End If
Else
'if there are no results - do you want to add the record?
'add the item here
add_to_temp_tbl_qry.AddNew
add_to_temp_tbl_qry!temp_id = unique_item_number
add_to_temp_tbl_qry.Update
End If
End With
Exit_save_button_click:
Exit Sub
Err_save_button_click:
MsgBox Err.Description
Resume Exit_save_button_click
End Sub
Tiny
Perfection is Everything
If it worked first time we wont be here!