Need help with this one

  • Thread starter Thread starter Syd
  • Start date Start date
S

Syd

I have a Main (parent) form which does a swapping of sub-
forms in a control called: "Embed_FormsSwap" The (child
forms are called: "A", "B", "C", "D" and so on. On each of
these (child forms) are controls for setting Day or Night
shift data entries called: "cboDayShift"
and "cboNightShift". Now I also have check boxes
called "chkHasDataOne" and "chkHasDataTwo" that get set to
=-1 every time the "cboDayShift" or "cboNightShift" drop
downs has a value or = 0 if there is no data.

These controls "cboDayShift" drop down
sets "chkHasDataOne" and "cboNightShift" Drop down
sets "chkHasDataTwo"

What I'd like to do is if the "cboDayShift" has a value
and the checkbox "chkHasDataOne" is set to =-1 and
the "cboNightShift" has no value and it's corresponding
checkbox "chkHasDataTwo" is = 0 have the form go to the
last incomplete record when it's re-opened, allowing
the "cboNightShift" to enter their data for the that shift
completing the record. However, it both "chkHasDataOne"
and "chkHasDataTwo" are equal to -1, have the form open to
acNewrec status.

Here is a sample of the code I have now, it works
intermittently.

If Me![chkHasDataOne] = -1 And Me![chkHasDataTwo] = 0 Then
DoCmd.GoToRecord , , acLast
Exit Sub
End If


If Me![chkHasDataOne] = -1 And Me![chkHasDataTwo] = -1 Then
DoCmd.GoToRecord , , acNewRec
Exit Sub
End If

Any idea on changes or assitance to make it work more
effeciently will be appreciated.

Thanks,.....
 
I would check to see which record is incomplete in the else clause and goto
that record.
 
Back
Top