Can't get record to display after data entry completion

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

Guest

I am having a most incredibly difficult time with the following process. I am
sorry for the long note, but it’s the only way I can describe what I am
trying to do.

I have a form with several controls: First, Last, FindIt, Package, SeqNo,
ID. The underlying table has the same fields except that the Package and
SeqNo are blank. They are to be filled in by the form. The only two
controls on the form that I want to tab are the FindIt and Package. The
Package GotFocus provides the SeqNo which is an increasing number, setting
the order in which I am entering the data.

The work flow I am attempting is as follows. I start with the focus on the
FindIt control where I enter an ID number. Its AfterUpdate event goes to the
proper record and sends me to the Package control where I enter a Package
designation (a letter, A, B, C, etc.).
The problem is when I press enter after entering the Package, and the focus
goes back to the FindIt control. The First and Last controls are now showing
a different record, I believe the next one base on the ID. I need them to
show the record just entered until I enter a new ID into the FindIt control.
(The ID and package are entered using a barcode scanner and I need to
visually varify that the correct record and package were entered.)

I have tried porbably every conceivable way to get the First and Last to
display from the record I just entered but have been unsuccessful. I believe
the OnCurrent event is the culprit that keeps changing the record on me, but
I don’t know how to avoid it.

Private Sub FindIt_AfterUpdate()
'Move to the record selected in the control
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.MoveFirst
rs.FindFirst "[ID] = " & Str(Nz(Me![FindIt], 0))

If rs.NoMatch Then
MsgBox "You entered a nonexistent record number", vbExclamation,
"Warning"
rs.Close
Set rs = Nothing
Exit Sub
Else
Me.Bookmark = rs.Bookmark
End If
rs.Close
Set rs = Nothing
'Me!Package.SetFocus
End Sub

If anyone has suggestions it would be greatly appreciated.

My email address is photopro at cox (remove this) dot net
 
Isaac wrote:
[snip]
The work flow I am attempting is as follows. I start with the focus
on the FindIt control where I enter an ID number. Its AfterUpdate
event goes to the proper record and sends me to the Package control
where I enter a Package designation (a letter, A, B, C, etc.).
The problem is when I press enter after entering the Package, and the
focus goes back to the FindIt control. The First and Last controls
are now showing a different record, I believe the next one base on
the ID. [snip]

Is the Package control the last control in the form's Tab Order? If so you
likely have you Cycle property of the form set to "All Records". With that
setting tabbing out of the last control on the form will take you to the next
record. Change that setting to "Current Record".
 
Wow!!! So right on! I wish I had written earlier and avoided hours
(actually days) of frustration. I never knew of that property. Thank you so
much (and for such a fast response, too).

Rick Brandt said:
Isaac wrote:
[snip]
The work flow I am attempting is as follows. I start with the focus
on the FindIt control where I enter an ID number. Its AfterUpdate
event goes to the proper record and sends me to the Package control
where I enter a Package designation (a letter, A, B, C, etc.).
The problem is when I press enter after entering the Package, and the
focus goes back to the FindIt control. The First and Last controls
are now showing a different record, I believe the next one base on
the ID. [snip]

Is the Package control the last control in the form's Tab Order? If so you
likely have you Cycle property of the form set to "All Records". With that
setting tabbing out of the last control on the form will take you to the next
record. Change that setting to "Current Record".
 
Back
Top