-----Original Message-----
I'm not exactly sure what you mean when you say they can
enter the number at any place in the control. If you
just want to trim the left 6 characters, you can just use
the Left function, such as Left(stringvalue,6). But, if
you are saying that they may have some leading spaces
before the number, you would have to write some code to
detect the first numeric character in the string.
In this case, you may want to add some validation code
that checks to see if the length of the string is = 6
using the len() function, and possibly also the isnumeric
function to make sure that the 6 characters are numeric.
Following that, you could choose whether to write code to
try to extract a 6 digit number from a longer number, or
whether to just notify the user that the input was not a
valid 6 digit number.
I'm not sure if this is what you were asking. If not,
post back with a little more info and I'll see if I have
any other ideas.
-Ted
-----Original Message-----
Great...you're 2 for 2...one more thing and I'll be out of
your hair...
I need to LTrim the ME.BNbr...the user seems to be able to
enter the 6 digit number at any place in the control and
so somethings the append does not work.
Ideas?
-----Original Message-----
Hi Deb,
Glad the requery worked for you. You should be able to
do clear the field with the following code statement (I
think that BNbr was the field you wanted to clear, if not
use the appropriate field name).
Me.BNbr = Null
-Ted
-----Original Message-----
that seemed to do the trick...is there a way I can reset
the text box to empty once the procedure is done? This
way the user doesn't have to erase the existing info
before starting on another batch number.
Thanks for the quick response by the way...
-----Original Message-----
You may just need to requery the form's recordset after
the append before you try to find the record. Try
inserting a Me.Requery statement in between.
-----Original Message-----
I have a form that a user enters a batch number and
after
pressing Enter it should:
1. append the new record in for that batch number
2. go to that record for that batch number.
This is what I have for code on the After Update...the
append works, but it doesn't bring the pointer to the
new
record...what am I doing wrong? Frustrating!!!!
Private Sub BNbr_AfterUpdate()
Dim stDocName As String
stDocName = "y_Form:SelectKitbyBatch"
DoCmd.OpenQuery stDocName, acNormal, acEdit
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[Batch] = '" & Me! [BNbr]
& "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
.
.
.
.
.
.