no idea what your application is supposed to do but 64 tables sound like your table/relationship design is wrong. And sorry, still 'bluey'. Your table, field, function and variable names are meaningless (to us), you reference variables and don't appear to declare them so we don't know what type they are, you pepper your code with comments and frequently your code is incomplete. And although you probably not been told to use them yet, please use the code tags (#) to highlight your code and retain indentation - e.g.
Code:
sub C() ' 8 MORE SUBS SO IF SUB M() CsDL CHANGES TO MsDL
If Tdis < 8 Then
Select Case Tsuf
Case "T"
TblH = "CsTh"
TblL = "CsTL"
Case "D"
TblH = "CsDh"
TblL = "CsDL" ' I changed TblL from a Dim to a public statment so sub 2 can use it
TblL should now be "CsDL" BUT!!!!
Me.theResult = ELookup("PCT", TblL, "RKT = '" & RkT & "'")
still has BtRef error and that has been the problem all along
call sub 2
end sub
I've highlighted your comments in red and this code is incomplete - there is no End Case so it is not clear at all where you are calling Elookup, and 'call sub 2' will not work
In your 'old db you have
Code:
Dim RkT As String '<<-- holds a value for the field RKT
Dim TblL As String '<<-- holds a value for the table/query name
TblL = Me.MyTable '<<-- table name from form
RkT = Me.RKTValue '<<-- tRKT Value from form
TblL COULD BE 8*8 64 DIFFERENT TABLES
Me.theResult = ELookup("PCT", TblL, "RKT = '" & RkT & "'")
in your C function you are using RkT, but I don't see it declared or assigned anywhere