Field accessing in standard module

Bakta

Registered User.
Local time
Today, 04:34
Joined
Aug 23, 2004
Messages
26
Hello,

Here is what trouble me :

In a standard module, I need to test an long field.

Public function test_Idx (Inref as Long) as Long
Dim stDocname as string
Dim T_idx as long
stDocname = "Edit_Form"
DoCmd.Openform stDocname,,,"[Ref_ctc]=" & Inref

So the form opens only where I want it to be tested. So far so good. Now I want to test [R_Idx], a long, and can't figure out how to get it :

- Me method does not work as it's a standard module.

I've tried :

T_idx = R_Idx
T_idx =stDocname.[R_Idx]
both gives me invalid qualifier errors which is understandable

But should I use the formal declaration :

T_idx = Forms!["Edit_Form"].[R_Idx]

I get a unable to find "Edit_Form" form and thus cannot proceed.

Can anyone please tell me what I do wrong?.
 
a choice :)

stDocName = "Edit_Form"
T_idx = Forms![Edit_Form].[R_Idx]
T_idx = Forms("Edit_Form").[R_Idx]
T_idx = Forms(stDocName).[R_Idx]
 
I feel so dumb at times, why did I had to think ".." were needed in brackets?.

Thanks

ps : no need to reply :p
 

Users who are viewing this thread

Back
Top Bottom