J
John Freeze
I am running Office97 patch 2.
I used the wizard to create a Recipe Database.
The person that I am making this for asked me to add in "Units Of Measure"
to the "Recipes Subform".
This was not a problem, but she wanted a pop up window like the
"Ingredients" table/form.
I created the table, form, and added in the following code (please see
below), but on a dbl click, nothing happens. When you dbl click on
ingredients, a new window opens.
Please any help would be greatly appreciated.
Thanks in advance.
Option Compare Database
Option Explicit
Private Sub IngredientID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub IngredientID_DblClick(Cancel As Integer)
On Error GoTo Err_IngredientID_DblClick
Dim lngIngredientID As Long
If IsNull(Me![IngredientID]) Then
Me![IngredientID].Text = ""
Else
lngIngredientID = Me![IngredientID]
Me![IngredientID] = Null
End If
DoCmd.OpenForm "Ingredients", , , , , acDialog, "GotoNew"
Me![IngredientID].Requery
If lngIngredientID <> 0 Then Me![IngredientID] = lngIngredientID
Exit_IngredientID_DblClick:
Exit Sub
Err_IngredientID_DblClick:
MsgBox Err.Description
Resume Exit_IngredientID_DblClick
End Sub
Private Sub UnitID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub UnitID_DblClick(Cancel As Integer)
On Error GoTo Err_UnitID_DblClick
Dim lngUnitID As Long
If IsNull(Me![UnitID]) Then
Me![IngredientID].Text = ""
Else
lngUnitID = Me![UnitID]
Me![UnitID] = Null
End If
DoCmd.OpenForm "Units", , , , , acDialog, "GotoNew"
Me![UnitID].Requery
If lngUnitID <> 0 Then Me![UnitID] = lngUnitID
Exit_UnitID_DblClick:
Exit Sub
Err_UnitID_DblClick:
MsgBox Err.Description
Resume Exit_UnitID_DblClick
End Sub
--
///, ////
\ /, / >.
\ /, _/ /.
\_ /_/ /.
\__/_ <
/<<< \_\_
/,)^>>_._ \
(/ \\ /\\\
// ````
======((`=======
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
I used the wizard to create a Recipe Database.
The person that I am making this for asked me to add in "Units Of Measure"
to the "Recipes Subform".
This was not a problem, but she wanted a pop up window like the
"Ingredients" table/form.
I created the table, form, and added in the following code (please see
below), but on a dbl click, nothing happens. When you dbl click on
ingredients, a new window opens.
Please any help would be greatly appreciated.
Thanks in advance.
Option Compare Database
Option Explicit
Private Sub IngredientID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub IngredientID_DblClick(Cancel As Integer)
On Error GoTo Err_IngredientID_DblClick
Dim lngIngredientID As Long
If IsNull(Me![IngredientID]) Then
Me![IngredientID].Text = ""
Else
lngIngredientID = Me![IngredientID]
Me![IngredientID] = Null
End If
DoCmd.OpenForm "Ingredients", , , , , acDialog, "GotoNew"
Me![IngredientID].Requery
If lngIngredientID <> 0 Then Me![IngredientID] = lngIngredientID
Exit_IngredientID_DblClick:
Exit Sub
Err_IngredientID_DblClick:
MsgBox Err.Description
Resume Exit_IngredientID_DblClick
End Sub
Private Sub UnitID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub UnitID_DblClick(Cancel As Integer)
On Error GoTo Err_UnitID_DblClick
Dim lngUnitID As Long
If IsNull(Me![UnitID]) Then
Me![IngredientID].Text = ""
Else
lngUnitID = Me![UnitID]
Me![UnitID] = Null
End If
DoCmd.OpenForm "Units", , , , , acDialog, "GotoNew"
Me![UnitID].Requery
If lngUnitID <> 0 Then Me![UnitID] = lngUnitID
Exit_UnitID_DblClick:
Exit Sub
Err_UnitID_DblClick:
MsgBox Err.Description
Resume Exit_UnitID_DblClick
End Sub
--
///, ////
\ /, / >.
\ /, _/ /.
\_ /_/ /.
\__/_ <
/<<< \_\_
/,)^>>_._ \
(/ \\ /\\\
// ````
======((`=======
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)