|
Creating a New Record |
|
|
|||
| Control | |||
| Form | Caption: Domba Ice Cream - New Customer Order | ||
| Navigation Buttons: No | |||
| Min Max Buttons: Min Enabled | |||
| Combo Box | Accompanying Label - Caption: Processed By | ||
| Name: cboEmployeeID | |||
| Row Source: SELECT DISTINCTROW Employees.EmployeeID, [FirstName] & " " & [LastName] AS Employee, Employees.Title FROM Employees; | |||
| Column Count: 3 | |||
| Column Widths: 0";1.25";1.5" | |||
| Bound Column: 1 | |||
| List Rows: 8 | |||
| List Width: 2.75" | |||
| Limit To List: Yes | |||
| Text Box | Accompanying Label - Caption: Order Date | ||
| Name: txtOrderDate | |||
| Format: Medium Date | |||
| Input Mask: 99/99/0000;0;_ | |||
| Text Box | Accompanying Label - Caption: Week Day | ||
| Name: txtDayOfWeek | |||
| Text Box | Accompanying Label - Caption: Order Time | ||
| Name: txtOrderTime | |||
| Format: Medium Time | |||
| Input Mask: 00:00;0;_ | |||
| Text Box | Accompanying Label - Caption: Period of Day | ||
| Name: txtPeriodOfDay | |||
| Combo Box | Accompanying Label - Caption: Container | ||
| Name: cboContainerID | |||
| Column Count: 2 | |||
| Column Heads: Yes | |||
| Column Widths: 0";1" | |||
| Bound Column: 1 | |||
| List Rows: 8 | |||
| List Width: 1" | |||
| Limit To List: Yes | |||
| Text Box | Accompanying Label - Caption: Scoops | ||
| Name: txtScoops | |||
| Combo Box | Accompanying Label - Caption: Flavor | ||
| Name: cboFlavorID | |||
| Row Source: SELECT DISTINCTROW [Flavors].[FlavorID], [Flavors].[Flavor] FROM [Flavors]; | |||
| Column Count: 2 | |||
| Column Widths: 0";1.5" | |||
| Bound Column: 1 | |||
| List Rows: 8 | |||
| List Width: 1.5" | |||
| Limit To List: Yes | |||
| Combo Box | Accompanying Label - Caption: Ingredient | ||
| Name: cboIngredientID | |||
| Row Source: | |||
| Column Count: 2 | |||
| Column Widths: 0";1" | |||
| Bound Column: 1 | |||
| List Rows: 8 | |||
| List Width: 1" | |||
| Limit To List: Yes | |||
| Text Box | Accompanying Label - Caption: Notes | ||
| Name: txtNotes | |||
| Command Button | Name: cmdSubmit | ||
| Caption: Submit | |||
| Command Button | Name: cmdReset | ||
| Caption: Reset | |||
| Command Button | Name: cmdClose | ||
| Caption: Close | |||
Private Sub cmbSubmit_Click()
On Error GoTo Err_cmbSubmit_Click
Dim rstOrder As ADODB.Recordset
Set rstOrder = New ADODB.Recordset
rstOrder.Open "CustomersOrders", CurrentProject.Connection, adOpenStatic, adLockOptimistic
If rstOrder.Supports(adAddNew) Then
With rstOrder
.AddNew
.Fields("EmployeeID") = cboEmployeeID
.Fields("OrderDate") = txtOrderDate
.Fields("DayOfWeek") = txtDayOfWeek
.Fields("OrderTime") = txtOrderTime
.Fields("PeriodOfDay") = txtPeriodOfDay
.Fields("ContainerID") = cboContainerID
.Fields("FlavorID") = cboFlavorID
.Fields("IngredientID") = cboIngredientID
.Fields("Notes") = txtNotes
.Update
cmdReset_Click
End With
End If
rstOrder.Close
Set rstOrder = Nothing
' DoCmd.Close
Exit_cmbSubmit_Click:
Exit Sub
Err_cmbSubmit_Click:
MsgBox Err.Description
Resume Exit_cmbSubmit_Click
End Sub
|
Private Sub cmdReset_Click()
On Error GoTo Err_cmdReset_Click
cboEmployeeID = ""
txtOrderDate = ""
txtDayOfWeek = ""
txtOrderTime = ""
txtPeriodOfDay = ""
cboContainerID = ""
txtScoops = ""
cboFlavorID = ""
cboIngredientID = ""
txtNotes = ""
cboEmployeeID.SetFocus
Exit_cmdReset_Click:
Exit Sub
Err_cmdReset_Click:
MsgBox Err.Description
Resume Exit_cmdReset_Click
End Sub
|
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
|
|
|
||
| Home | Copyright © 2004 FunctionX, Inc. | |
|
|
||