access list missing field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I cannot locate a field that should be (?) in the auto Access List provided.

I am using a bound form to and access has no problem in recognising the
fileds within the form. It also has no problem recognising the fields from
EM01M, EM01F to EM15M and EM15F. Yesterday I added a couple of extra fields
to the form and when I add these new fields to the code (for validation -
BeforeUpdate) I get the Compile Error: Method or Data Member Not Found.

Any suggestions?

Here's the line of code that's giving me the problem:

If test < (Me.EM01M + Me.EM01F + Me.EM02M + Me.EM02F + Me.EM03M + Me.EM03F +
Me.EM04M + Me.EM04F + Me.EM05M + Me.EM05F + Me.EM06M + Me.EM06F + Me.EM07M +
Me.EM07F + Me.EM08M + Me.EM08F + Me.EM09M + Me.EM09F + Me.EM10M + Me.EM10F +
Me.EM11M + Me.EM11F + Me.EM12M + Me.EM12F + Me.EM13M + Me.EM13F + Me.EM14M +
Me.EM14F + Me.EM15M + Me.EM15F + Me.EM16M + Me.EM16F) Then
MsgBox ("Check Section 4: Ethic Minorities - Number of students
from ethnic minorities exceeds total number of students")
Cancel = True

So to recap - the code works fine up until EM15 and then can no longer
locate the fields from EM16. It's in the form and the underlying table, why
doesn't it appear in the access list? Why can't I reference it?

Hope this is clear.

Thanks,
Ronnie.
 
I would seriously review normalizing information since it looks like you are
storing values in field names. I could be wrong.

I believe the issue might be the long length of your statement. There is a
limit to the length of a single line of code. You might want to divide this
up like:
Dim dbl1_7 As Double
Dim dbl8_16 As Double
dbl1_7 = Me.EM01M + Me.EM01F + Me.EM02M + Me.EM02F + _
Me.EM03M + Me.EM03F + Me.EM04M + Me.EM04F + _
Me.EM05M + Me.EM05F + Me.EM06M + Me.EM06F + _
Me.EM07M + Me.EM07F
dbl8_16 = Me.EM08M + Me.EM08F + Me.EM09M + Me.EM09F + _
Me.EM10M + Me.EM10F + Me.EM11M + Me.EM11F + _
Me.EM12M + Me.EM12F + Me.EM13M + Me.EM13F + _
Me.EM14M + Me.EM14F + Me.EM15M + Me.EM15F + _
Me.EM16M + Me.EM16F
If test < dbl1_7 + dbl8_16 Then
'...
 
Hello Duane,

Thanks for the prompt reply - in the meantime i simply re-selected the
record source in the form's properties and it seemed to refresh the list. So
all is well now.

Can you explain what "normalising information" means? And why you shouldn't
store values in field names? I'm new to creating forms (and code) so any
advice would be great.

Thanks for your help!

Ronnie.
 
Back
Top