Programming challenge. Please help!

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

Guest

Hi:

I created a form that has a subform. The form pulls information from a
query and the subform from a linked database. The subform has a program
which is supposed enter initials in a field depending on what first four
numbers are in the second field.
ie: In the second field if we enter 12323444343 and the first four numbers
are 1232 the the initials AE are supposed to be entered in another field.

This is what I have for the subform.

Option Compare Database
Option Explicit

Private Sub Form_Load()

End Sub

Private Sub Holdbar_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Keystartpull_BeforeUpdate(Cancel As Integer)
Dim kstart1Pull
If Left(Keystartpull, 4) = "0246" Then
kstart1Pull = "KI"
End If

Kstart2Pull = kstart1Pull

End Sub

The problem is that this is not working. A the fields that this program is
reffering to are (acurate lowercase appercase):

Keystartpull
Keystoppull
keystart1pull
keystop1pull
Holdbard


When ever I try to change the names on the program to accuratelly reflect
the names of the fields in the table, they automatically change to different
case. why!!!!! I need this to work as soon as possible. If anywould could
give me any advice I would trully appreciate it.

Thanks
 
kitty said:
I created a form that has a subform. The form pulls information from a
query and the subform from a linked database. The subform has a program
which is supposed enter initials in a field depending on what first four
numbers are in the second field.
ie: In the second field if we enter 12323444343 and the first four numbers
are 1232 the the initials AE are supposed to be entered in another field.

This is what I have for the subform.

Option Compare Database
Option Explicit

Private Sub Form_Load()

End Sub

Private Sub Holdbar_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Keystartpull_BeforeUpdate(Cancel As Integer)
Dim kstart1Pull
If Left(Keystartpull, 4) = "0246" Then
kstart1Pull = "KI"
End If

Kstart2Pull = kstart1Pull

End Sub

The problem is that this is not working. A the fields that this program is
reffering to are (acurate lowercase appercase):

Keystartpull
Keystoppull
keystart1pull
keystop1pull
Holdbard


When ever I try to change the names on the program to accuratelly reflect
the names of the fields in the table, they automatically change to different
case. why!!!!!

I have no idea what you want to work, but I can tell you
that the case of the names you use in Access doesn't matter.
Access is not case sensitive, but it does try to "clean up"
your code by replacing the case you type to make it match
the case you used to declare the name. I say "try" because
sometimes it gets confused about which definition to use and
even sometimes continues to use a declaration after you've
deleted it. For instance, you say the "field" has case
keystart1pull, but the procedure you posted declares the
variable kstart1Pull.
 
Back
Top