Code Challenge

Tom Vert

New Member
Joined
Oct 30, 2004
Messages
43
Hi Folks

Any ideas on why the following code does not open a pop form with information linked to the SERIES field in my table? The data is a number (but could be text) and formatted as '0000' The numbers are not distinct (several numbers repeat many times) and I simply want to double click a control a form and have open another form with appropriate data.

Thanks for your help.

Private Sub SERIES_DblClick(Cancel As Integer)

On Error GoTo Err_SERIES_DblClick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmSERIES DEFINITIONS"

stLinkCriteria = "[SERIES]=" & "'" & Me![SERIES] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_SERIES_DblClick:
Exit Sub

Err_SERIES_DblClick:
MsgBox Err.Description
Resume Exit_SERIES_DblClick

End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
You might want do define the Me! forms. Some time, I don't know why Access get confuse with the Me!. I rather specified each time the complet name of the form where the data are.

good luck
 
Upvote 0
The form pops up, but there's no data. Not sure why ... I have an identical procedure in an adjacent control and it works fine. Frustration is setting in. :confused:
 
Upvote 0
If the field is numeric, you'll want to get rid of the single quotes:

stLinkCriteria = "[SERIES]=" & Me![SERIES]

HTH,
Russell
 
Upvote 0
Thanks Russell. I changed the code, but instead of getting a pop up with no data, I get a Microsoft Access error:

"The OpenForm action was canceled." With no reason why.

Do you think the duplicate numbers in the field are causing a linkage problem? Tom
 
Upvote 0
Sorry, I couldn't say without more info. Do you know how to step through code? I'd start there...
 
Upvote 0
I'm pretty much a "frustrated novice" and don't know how to step thru code. Are you speaking of the immediate window and a line-by-line approach?
 
Upvote 0
Technically not the immediate window, but probably what you're referring to. You can set breakpoints and see what's going on. There are a lot of factors that could be in play here, including how your "pop form" functions. I'm sorry I can't be of more help...
 
Upvote 0

Forum statistics

Threads
1,211,458
Messages
6,101,969
Members
447,766
Latest member
cool_aikon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top