Hi, I am in a quandary! I have a subform viewed as a datasheet for entering products for my order. I need to be able to use message boxes and command buttons for the criteria I need. Do I add a main form to it, make it a popup or what? The subform is on my Main form where I do Order Entry. On this form I need a vba message box to run before they agree to finalize the order.Here is my code for it; The form is a Order Details form for entering products. Here is a pic og main form with subform on it.
Option Compare Database
Private Sub Command22_Click()
Dim AddItemsAsInventorymsgbox As String
AddItemsAsInventorymsgbox = MsgBox("Do you want to Allocate these items to inventory?", vbInformation + vbYesNo, "OrderDetailsSubform")
If (AddItemsAsInventorymsgbox = vbYes) Then
DoCmd.SetWarnings False
[Post].Enabled = True
[Post].Visible = True
DoCmd.OpenQuery "UpdateProductsTableFromOrderDetailsTableProdu cts"
DoCmd.SetWarnings True
DoCmd.Save
End If
End Sub