From: John Quinn on
Sorry Guys, I rarely use Sub-Routines.

I want to continue where I left off.

Do not know what is wrong with the code below.



Private Sub WeekNo_GotFocus()

Dim W As Byte

W = 18
HoldWeek (W)
Me!WeekNo = W

End Sub
Public Sub HoldWeek(W As Byte) ' Comes in Correctly

Dim db As DAO.database
Dim rst As DAO.Recordset

Set db = CurrentDb

Set rst = db.OpenRecordset("Select * From WeeklySchedule")

rst.MoveLast
W = rst!WeekNo ' This is the number 9

End Sub

The correct Week # is 9 and it is stored correctly. When I return to the
calling Sub-Routine it stay at 18. I cannot get it to go to 9.

Is it because I am using Got Focus?

Any Help Appreciated

Thanks in Advance

JQ
From: Mayayana on
Whatever you're using, it's not VBScript.

| Sorry Guys, I rarely use Sub-Routines.
|
| I want to continue where I left off.
|
| Do not know what is wrong with the code below.
|
|
|
| Private Sub WeekNo_GotFocus()
|
| Dim W As Byte
|
| W = 18
| HoldWeek (W)
| Me!WeekNo = W
|
| End Sub
| Public Sub HoldWeek(W As Byte) ' Comes in Correctly
|
| Dim db As DAO.database
| Dim rst As DAO.Recordset
|
| Set db = CurrentDb
|
| Set rst = db.OpenRecordset("Select * From WeeklySchedule")
|
| rst.MoveLast
| W = rst!WeekNo ' This is the number 9
|
| End Sub
|
| The correct Week # is 9 and it is stored correctly. When I return to the
| calling Sub-Routine it stay at 18. I cannot get it to go to 9.
|
| Is it because I am using Got Focus?
|
| Any Help Appreciated
|
| Thanks in Advance
|
| JQ


From: Bob Barrows on
It appears you intended to post this to an Access VBA group since this
certainly is not vbscript
John Quinn wrote:
> Sorry Guys, I rarely use Sub-Routines.
>
> I want to continue where I left off.
>
> Do not know what is wrong with the code below.
>
>
>
> Private Sub WeekNo_GotFocus()
>

--
HTH,
Bob Barrows