 | 
28-Jul-2006, 08:12 AM
|  | Guest | | | | | | | | | | Problems w/ FindFirst The code below resides in a loop. It works fine, for the first record, but
none of the others. The 'Findfirst' line searches for the proper ItemID,
however, it continues to attempt to update the first record of the table.
Any suggestions on what I'm doing wrong? Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/10442-problems-w-findfirst.htmlReference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
Thanks, in advance.
Sharkbyte
Dim MyDB As Database
Dim MyDetail As Recordset
Set MyDB = CurrentDb()
Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
..MoveFirst
..FindFirst ("itemid = '" & gblItemID & "' ")
With MyDetail
.Edit
!ItemStatus = "Received"
!QuantityReceived = !QuantityOrdered
.Update
End With Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh! | 
28-Jul-2006, 08:12 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst Hi Sharkbyte,
Why not use an UPDATE query...
'~~~~~~~~~~~~~~~~~~~~
dim strSQL as string
strSQL = "UPDATE tblpurchaseorderdetails " _
& " SET ItemStatus = 'Received', " _
& " QuantityReceived = nz(QuantityOrdered) " _
& " WHERE itemid '" & gblItemID & "';"
debug.print strSql
currentdb.execute strSQL
'~~~~~~~~~~~~~~~~~~~~ Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
** debug.print ***
debug.print strSQL
--> this prints a copy of the SQL statement to the debug
window (CTRL-G)
After you execute your code, open the Debug window
CTRL-G to Goto the debuG window -- look at the SQL statement
If the SQL statement has an error
1. Make a new query (design view)
2. choose View, SQL from the menu
(or SQL from the toolbar, first icon)
3. cut the SQL statement from the debug window
(select, CTRL-X)
4. paste into the SQL window of the Query
(CTRL-V)
5. run ! from the SQL window Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
-- Access will tell you where the problem is in the SQL
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*
Sharkbyte wrote:
> The code below resides in a loop. It works fine, for the first record, but
> none of the others. The 'Findfirst' line searches for the proper ItemID,
> however, it continues to attempt to update the first record of the table.
>
> Any suggestions on what I'm doing wrong?
>
> Thanks, in advance.
>
> Sharkbyte
>
>
> Dim MyDB As Database
> Dim MyDetail As Recordset
>
> Set MyDB = CurrentDb()
> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>
> .MoveFirst
> .FindFirst ("itemid = '" & gblItemID & "' ")
>
> With MyDetail
> .Edit
> !ItemStatus = "Received"
> !QuantityReceived = !QuantityOrdered
> .Update
> End With | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst Well, even if that code is within a loop that you haven't shown, it will
not work because you are always telling it to .FindFirst ;-)
Your Dim and Set statements belong outside your loop, and you need to use a Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
..FindNext within the loop. Something like:
Dim MyDB As Database
Dim MyDetail As DAO.Recordset 'disambiguate the recordset type
Set MyDB = CurrentDb()
Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
..MoveFirst
Do While Not MyDetail.EOF
.FindNext ("itemid = '" & gblItemID & "' ")
With MyDetail
.Edit
!ItemStatus = "Received"
!QuantityReceived = !QuantityOrdered
.Update
End With
Loop
Having said that, I'd actually build and execute an SQL string to do your
update, as Crystal suggests. My reply is merely to assist you in
understanding how to set up a loop that works ;-)
HTH,
Rob
"Sharkbyte" wrote in message
news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
> The code below resides in a loop. It works fine, for the first record,
> but
> none of the others. The 'Findfirst' line searches for the proper ItemID,
> however, it continues to attempt to update the first record of the table.
>
> Any suggestions on what I'm doing wrong?
>
> Thanks, in advance.
>
> Sharkbyte
>
>
> Dim MyDB As Database
> Dim MyDetail As Recordset
>
> Set MyDB = CurrentDb()
> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>
> .MoveFirst
> .FindFirst ("itemid = '" & gblItemID & "' ")
>
> With MyDetail
> .Edit
> !ItemStatus = "Received"
> !QuantityReceived = !QuantityOrdered
> .Update
> End With | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst -- FindFirst before loop, FindNext inloop Thanks, Rob
It is a good idea to help Sharkbyte understand the logic
errors instead of just suggesting a different method, thanks
for that
just have a couple comments on the code that Rob posted ...
in case the FIRST record contains what is being sought... do
..FindFirst before the loop (do not believe that .FindNext
will stay on the same record...)
Object variables need to be released when you are done with them
'~~~~~~~~~~~~~~~~~~~~~~~~~~
'NEEDS REFERENCE TO
'Microsoft DAO Object Library
Dim MyDB As DAO.Database
Dim MyDetail As DAO.Recordset
Set MyDB = CurrentDb()
Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
With MyDetail
.FindFirst "itemid = '" & gblItemID & "'"
if not MyDetail.NoMatch then
Do
.Edit
!ItemStatus = "Received"
!QuantityReceived = !QuantityOrdered
.Update
.FindNext "itemid = '" & gblItemID & "'"
Loop WHILE not MyDetail.NoMatch
end if
end with
'close/release object variables
MyDetail.close
set MyDetail = nothing
set MyDB = nothing
'~~~~~~~~~~~~~~~~~~~~~~~~~~
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*
Rob Parker wrote:
> Well, even if that code is within a loop that you haven't shown, it will
> not work because you are always telling it to .FindFirst ;-)
>
> Your Dim and Set statements belong outside your loop, and you need to use a
> .FindNext within the loop. Something like:
>
> Dim MyDB As Database
> Dim MyDetail As DAO.Recordset 'disambiguate the recordset type Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>
> Set MyDB = CurrentDb()
> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>
> .MoveFirst
>
> Do While Not MyDetail.EOF
> .FindNext ("itemid = '" & gblItemID & "' ")
> With MyDetail
> .Edit
> !ItemStatus = "Received"
> !QuantityReceived = !QuantityOrdered
> .Update
> End With
> Loop
>
> Having said that, I'd actually build and execute an SQL string to do your
> update, as Crystal suggests. My reply is merely to assist you in
> understanding how to set up a loop that works ;-)
>
> HTH,
>
> Rob
>
>
> "Sharkbyte" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
> news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
>
>>The code below resides in a loop. It works fine, for the first record,
>>but
>>none of the others. The 'Findfirst' line searches for the proper ItemID,
>>however, it continues to attempt to update the first record of the table.
>>
>>Any suggestions on what I'm doing wrong?
>>
>>Thanks, in advance.
>>
>>Sharkbyte
>>
>>
>>Dim MyDB As Database
>>Dim MyDetail As Recordset
>>
>>Set MyDB = CurrentDb()
>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>
>>.MoveFirst
>>.FindFirst ("itemid = '" & gblItemID & "' ")
>>
>>With MyDetail
>> .Edit
>> !ItemStatus = "Received"
>> !QuantityReceived = !QuantityOrdered
>> .Update
>>End With
>
>
> | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst -- FindFirst before loop, FindNext in loop Thanks for the minor amendments to my air-code example, Crystal.
Rob
"strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
news:OkJHMjogGHA.3996@TK2MSFTNGP03.phx.gbl...
> Thanks, Rob 
>
> It is a good idea to help Sharkbyte understand the logic errors instead of
> just suggesting a different method, thanks for that
>
> just have a couple comments on the code that Rob posted ...
>
> in case the FIRST record contains what is being sought... do .FindFirst
> before the loop (do not believe that .FindNext will stay on the same
> record...)
>
> Object variables need to be released when you are done with them
>
> '~~~~~~~~~~~~~~~~~~~~~~~~~~
> 'NEEDS REFERENCE TO
> 'Microsoft DAO Object Library
>
> Dim MyDB As DAO.Database
> Dim MyDetail As DAO.Recordset
>
> Set MyDB = CurrentDb()
> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>
> With MyDetail
>
> .FindFirst "itemid = '" & gblItemID & "'"
>
> if not MyDetail.NoMatch then
> Do Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
> .Edit
> !ItemStatus = "Received"
> !QuantityReceived = !QuantityOrdered
> .Update
> .FindNext "itemid = '" & gblItemID & "'"
> Loop WHILE not MyDetail.NoMatch
> end if
>
> end with
>
> 'close/release object variables
> MyDetail.close
> set MyDetail = nothing
> set MyDB = nothing
> '~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Warm Regards,
> Crystal
> Microsoft Access MVP 2006
>
> *
> Have an awesome day  Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>
> remote programming and training
> strive4peace2006 at yahoo.com
>
> *
>
> Rob Parker wrote:
>> Well, even if that code is within a loop that you haven't shown, it will
>> not work because you are always telling it to .FindFirst ;-)
>>
>> Your Dim and Set statements belong outside your loop, and you need to use
>> a .FindNext within the loop. Something like:
>>
>> Dim MyDB As Database
>> Dim MyDetail As DAO.Recordset 'disambiguate the recordset type
>>
>> Set MyDB = CurrentDb()
>> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>
>> .MoveFirst
>>
>> Do While Not MyDetail.EOF
>> .FindNext ("itemid = '" & gblItemID & "' ")
>> With MyDetail
>> .Edit
>> !ItemStatus = "Received"
>> !QuantityReceived = !QuantityOrdered
>> .Update
>> End With
>> Loop
>>
>> Having said that, I'd actually build and execute an SQL string to do your
>> update, as Crystal suggests. My reply is merely to assist you in
>> understanding how to set up a loop that works ;-)
>>
>> HTH,
>>
>> Rob
>>
>>
>> "Sharkbyte" wrote in message
>> news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
>>
>>>The code below resides in a loop. It works fine, for the first record,
>>>but
>>>none of the others. The 'Findfirst' line searches for the proper ItemID,
>>>however, it continues to attempt to update the first record of the table.
>>>
>>>Any suggestions on what I'm doing wrong?
>>>
>>>Thanks, in advance.
>>>
>>>Sharkbyte
>>>
>>>
>>>Dim MyDB As Database
>>>Dim MyDetail As Recordset
>>>
>>>Set MyDB = CurrentDb()
>>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>>
>>>.MoveFirst
>>>.FindFirst ("itemid = '" & gblItemID & "' ")
>>>
>>>With MyDetail
>>> .Edit
>>> !ItemStatus = "Received"
>>> !QuantityReceived = !QuantityOrdered
>>> .Update
>>>End With
>>
>> | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst I actually began with an Update query. I went this way because I appeared to
be having problems with not being able to requery a subform because the
transaction hadn't completed.
But thanks for the help.
Sharkbyte
"strive4peace" <"strive4peace2006 at yaho" wrote:
> Hi Sharkbyte,
>
> Why not use an UPDATE query...
>
> '~~~~~~~~~~~~~~~~~~~~
> dim strSQL as string
> strSQL = "UPDATE tblpurchaseorderdetails " _
> & " SET ItemStatus = 'Received', " _
> & " QuantityReceived = nz(QuantityOrdered) " _
> & " WHERE itemid '" & gblItemID & "';"
> debug.print strSql
> currentdb.execute strSQL
> '~~~~~~~~~~~~~~~~~~~~
>
> ** debug.print ***
>
> debug.print strSQL
>
> --> this prints a copy of the SQL statement to the debug
> window (CTRL-G)
>
> After you execute your code, open the Debug window
> CTRL-G to Goto the debuG window -- look at the SQL statement
>
> If the SQL statement has an error
>
> 1. Make a new query (design view)
>
> 2. choose View, SQL from the menu
> (or SQL from the toolbar, first icon) Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>
> 3. cut the SQL statement from the debug window
> (select, CTRL-X)
>
> 4. paste into the SQL window of the Query
> (CTRL-V)
>
> 5. run ! from the SQL window Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
> -- Access will tell you where the problem is in the SQL
>
>
> Warm Regards,
> Crystal
> Microsoft Access MVP 2006
>
> *
> Have an awesome day 
>
> remote programming and training
> strive4peace2006 at yahoo.com
>
> *
>
> Sharkbyte wrote:
> > The code below resides in a loop. It works fine, for the first record, but
> > none of the others. The 'Findfirst' line searches for the proper ItemID,
> > however, it continues to attempt to update the first record of the table.
> >
> > Any suggestions on what I'm doing wrong?
> >
> > Thanks, in advance.
> >
> > Sharkbyte
> >
> >
> > Dim MyDB As Database
> > Dim MyDetail As Recordset
> >
> > Set MyDB = CurrentDb()
> > Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
> >
> > .MoveFirst
> > .FindFirst ("itemid = '" & gblItemID & "' ")
> >
> > With MyDetail
> > .Edit
> > !ItemStatus = "Received"
> > !QuantityReceived = !QuantityOrdered
> > .Update
> > End With
> | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst Thanks for the lesson. It was my first time using this method. I have gone
back to the Update query, but will keep your tips in mind.
Sharkbyte
"Rob Parker" wrote:
> Well, even if that code is within a loop that you haven't shown, it will
> not work because you are always telling it to .FindFirst ;-)
>
> Your Dim and Set statements belong outside your loop, and you need to use a
> ..FindNext within the loop. Something like:
>
> Dim MyDB As Database
> Dim MyDetail As DAO.Recordset 'disambiguate the recordset type Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>
> Set MyDB = CurrentDb()
> Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>
> ..MoveFirst
>
> Do While Not MyDetail.EOF
> .FindNext ("itemid = '" & gblItemID & "' ")
> With MyDetail
> .Edit
> !ItemStatus = "Received"
> !QuantityReceived = !QuantityOrdered
> .Update
> End With
> Loop
>
> Having said that, I'd actually build and execute an SQL string to do your
> update, as Crystal suggests. My reply is merely to assist you in
> understanding how to set up a loop that works ;-)
>
> HTH,
>
> Rob
>
>
> "Sharkbyte" wrote in message
> news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
> > The code below resides in a loop. It works fine, for the first record,
> > but
> > none of the others. The 'Findfirst' line searches for the proper ItemID,
> > however, it continues to attempt to update the first record of the table. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
> >
> > Any suggestions on what I'm doing wrong?
> >
> > Thanks, in advance.
> >
> > Sharkbyte
> >
> >
> > Dim MyDB As Database
> > Dim MyDetail As Recordset
> >
> > Set MyDB = CurrentDb()
> > Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
> >
> > .MoveFirst
> > .FindFirst ("itemid = '" & gblItemID & "' ")
> >
> > With MyDetail
> > .Edit
> > !ItemStatus = "Received"
> > !QuantityReceived = !QuantityOrdered
> > .Update
> > End With
>
>
> | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst -- FindFirst before loop, FindNext inloop Hi Rob,
you're welcome  We are all in this together seeking a
common goal
glad you were not offended by my "air-comments"! I
appreciated your add-on to what I wrote and to help
Sharkbyte understand why his code didn't work. Have a safe
and happy holiday, Rob.
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*
Rob Parker wrote:
> Thanks for the minor amendments to my air-code example, Crystal.
>
> Rob
>
> "strive4peace" <"strive4peace2006 at yahoo dot com"> wrote in message
> news:OkJHMjogGHA.3996@TK2MSFTNGP03.phx.gbl...
>
>>Thanks, Rob 
>>
>>It is a good idea to help Sharkbyte understand the logic errors instead of
>>just suggesting a different method, thanks for that
>>
>>just have a couple comments on the code that Rob posted ...
>>
>>in case the FIRST record contains what is being sought... do .FindFirst
>>before the loop (do not believe that .FindNext will stay on the same
>>record...)
>>
>>Object variables need to be released when you are done with them
>>
>>'~~~~~~~~~~~~~~~~~~~~~~~~~~
>>'NEEDS REFERENCE TO
>>'Microsoft DAO Object Library
>>
>>Dim MyDB As DAO.Database
>>Dim MyDetail As DAO.Recordset Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>>
>>Set MyDB = CurrentDb()
>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>
>>With MyDetail
>>
>> .FindFirst "itemid = '" & gblItemID & "'"
>>
>> if not MyDetail.NoMatch then
>> Do
>> .Edit
>> !ItemStatus = "Received"
>> !QuantityReceived = !QuantityOrdered
>> .Update
>> .FindNext "itemid = '" & gblItemID & "'"
>> Loop WHILE not MyDetail.NoMatch
>> end if
>>
>>end with
>>
>>'close/release object variables
>>MyDetail.close
>>set MyDetail = nothing
>>set MyDB = nothing
>>'~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>Warm Regards,
>>Crystal
>>Microsoft Access MVP 2006
>>
>> *
>> Have an awesome day 
>>
>> remote programming and training
>> strive4peace2006 at yahoo.com
>>
>> *
>>
>>Rob Parker wrote:
>>
>>>Well, even if that code is within a loop that you haven't shown, it will
>>>not work because you are always telling it to .FindFirst ;-)
>>>
>>>Your Dim and Set statements belong outside your loop, and you need to use
>>>a .FindNext within the loop. Something like:
>>>
>>>Dim MyDB As Database
>>>Dim MyDetail As DAO.Recordset 'disambiguate the recordset type
>>>
>>>Set MyDB = CurrentDb()
>>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>>
>>>.MoveFirst
>>>
>>>Do While Not MyDetail.EOF
>>> .FindNext ("itemid = '" & gblItemID & "' ")
>>> With MyDetail
>>> .Edit
>>> !ItemStatus = "Received"
>>> !QuantityReceived = !QuantityOrdered
>>> .Update
>>> End With
>>>Loop
>>>
>>>Having said that, I'd actually build and execute an SQL string to do your
>>>update, as Crystal suggests. My reply is merely to assist you in
>>>understanding how to set up a loop that works ;-)
>>>
>>>HTH,
>>>
>>>Rob
>>>
>>>
>>>"Sharkbyte" wrote in message
>>>news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
>>>
>>>
>>>>The code below resides in a loop. It works fine, for the first record,
>>>>but
>>>>none of the others. The 'Findfirst' line searches for the proper ItemID, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>>>>however, it continues to attempt to update the first record of the table.
>>>>
>>>>Any suggestions on what I'm doing wrong?
>>>>
>>>>Thanks, in advance.
>>>>
>>>>Sharkbyte
>>>>
>>>>
>>>>Dim MyDB As Database
>>>>Dim MyDetail As Recordset
>>>>
>>>>Set MyDB = CurrentDb()
>>>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>>>
>>>>.MoveFirst
>>>>.FindFirst ("itemid = '" & gblItemID & "' ")
>>>>
>>>>With MyDetail
>>>> .Edit
>>>> !ItemStatus = "Received"
>>>> !QuantityReceived = !QuantityOrdered
>>>> .Update
>>>>End With
>>>
>>>
> | 
28-Jul-2006, 08:13 AM
|  | Guest | | | | | | | | | | Re: Problems w/ FindFirst you welcome, Sharkbyte  happy to help
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*
Sharkbyte wrote:
> Thanks for the lesson. It was my first time using this method. I have gone
> back to the Update query, but will keep your tips in mind.
>
> Sharkbyte
>
>
>
> "Rob Parker" wrote:
>
>
>>Well, even if that code is within a loop that you haven't shown, it will
>>not work because you are always telling it to .FindFirst ;-)
>>
>>Your Dim and Set statements belong outside your loop, and you need to use a
>>..FindNext within the loop. Something like:
>>
>>Dim MyDB As Database
>>Dim MyDetail As DAO.Recordset 'disambiguate the recordset type
>>
>>Set MyDB = CurrentDb()
>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails")
>>
>>..MoveFirst
>>
>>Do While Not MyDetail.EOF
>> .FindNext ("itemid = '" & gblItemID & "' ")
>> With MyDetail
>> .Edit
>> !ItemStatus = "Received"
>> !QuantityReceived = !QuantityOrdered
>> .Update
>> End With
>>Loop
>>
>>Having said that, I'd actually build and execute an SQL string to do your
>>update, as Crystal suggests. My reply is merely to assist you in
>>understanding how to set up a loop that works ;-)
>>
>>HTH,
>>
>>Rob
>>
>>
>>"Sharkbyte" wrote in message
>>news:EFA8EF96-1E17-46AF-A750-8D7ACA0B6199@microsoft.com...
>>
>>>The code below resides in a loop. It works fine, for the first record,
>>>but
>>>none of the others. The 'Findfirst' line searches for the proper ItemID, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>>>however, it continues to attempt to update the first record of the table.
>>>
>>>Any suggestions on what I'm doing wrong?
>>>
>>>Thanks, in advance.
>>>
>>>Sharkbyte
>>>
>>>
>>>Dim MyDB As Database
>>>Dim MyDetail As Recordset
>>>
>>>Set MyDB = CurrentDb()
>>>Set MyDetail = MyDB.OpenRecordset("tblpurchaseorderdetails") Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10442
>>>
>>>.MoveFirst
>>>.FindFirst ("itemid = '" & gblItemID & "' ")
>>>
>>>With MyDetail
>>> .Edit
>>> !ItemStatus = "Received"
>>> !QuantityReceived = !QuantityOrdered
>>> .Update
>>>End With
>>
>>
>> | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | Panjabi Today 02:14 AM 9 Replies, 206 Views | | | | | | | » Books You Should Read... | | | |