DBL click problem.

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)
 
J

Jeff Boyce

John

I don't know if it is relevant to your problem, but your code for the "Unit"
double-click refers to the textbox for Ingredient...

It is considered poor netiquette to "blast" your question to so many
newsgroups. Generally, most questions can be best handled in one (or maybe
two) 'groups.
 
F

Freeze

Fixed that error, but sadly no fix the problem.

I did not mean to blast the groups, and sorry for doing so.

Any other ideas?
Thanks Jeff

Jeff Boyce said:
John

I don't know if it is relevant to your problem, but your code for the "Unit"
double-click refers to the textbox for Ingredient...

It is considered poor netiquette to "blast" your question to so many
newsgroups. Generally, most questions can be best handled in one (or maybe
two) 'groups.

--
Good luck

Jeff Boyce
<Access MVP>

John Freeze said:
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)
 
J

John Freeze

FOUND the problem. :) Thanks to those that tried to help :) I had the name
wrong for the Combo Window. It was named Combo13 instead of UnitID.

Thanks again all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top