Re: Help with while ...loop Statements
From: Bre-x (cholotron_at_hotmail.com)
Date: 11/30/04
- Next message: Graham R Seach: "Re: Help with while ...loop Statements"
- Previous message: Benedict Appleby: "Recurring record entry"
- In reply to: Graham R Seach: "Re: Help with while ...loop Statements"
- Next in thread: Graham R Seach: "Re: Help with while ...loop Statements"
- Reply: Graham R Seach: "Re: Help with while ...loop Statements"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 29 Nov 2004 19:00:34 -0700
Graham, thanks for answering my question
Yes, tt does not return a value, doesnt have to. But it accomplish what I
need.
It's partial shipment DB.
The user enter a Sales Order Number
Sales Order is displayed.
for each Sales Order Line that is marked (R Field)
my function send a insert and update statement to a Pervasive SQL Server.
I am been able to accomplish it by running a Make Table Query ( this query
has my function).
Believe it works fine.
But the only way I am able to find out what Sales Orders been marked to be
ship is by running this query.
I am pretty sure there is a way to read the Sales Order Line Table go into
each record, check the R Field
and every time it is marked (-1) send my Insert and Update sql scripts to
the sql server
Regards,
Bre-x
----- Original Message -----
From: "Graham R Seach" <gseach@NOSPAMpacificdb.com.au>
Newsgroups: microsoft.public.access.gettingstarted
Sent: Monday, November 29, 2004 6:39 PM
Subject: Re: Help with while ...loop Statements
> doSHP() doesn't return a value, so it's use in the SELECT INTO query
doesn't
> quite do what you think it does.
>
> What are you really trying to do?
>
> Regards,
> Graham R Seach
> Microsoft Access MVP
> Sydney, Australia
>
> Microsoft Access 2003 VBA Programmer's Reference
> http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
>
>
> "Bre-x" <cholotron@hotmail.com> wrote in message
> news:OO71Lun1EHA.2016@TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > I have a table where there's a "R" field (Yes/No Type)
> > For every record where R equals to -1 I have a function that do
> > "something"
> >
> > I am able to accomplish this by creating a query with a function on it
> >
> > But couldn't I accomplish this with a while..loop or for....each
> > statement?
> >
> > How to I read my table and go into each record and read the "R" Field?
> >
> >
> > Thank you All
> >
> > Bre-x
> >
> >
> > 'Here is the Query
> > SELECT SOL.SONUM, SOL.L, SOL.MS, SOL.R, SOL.RQTY,
> > doSHP([SONUM],[L],[R],[RQTY]) AS DoSHPFunction INTO Temp
> > FROM SOL;
> >
> > 'Here is the Function
> > Function doSHP(SONUM, SOLINE, R, RQTY)
> > If R = -1 Then
> > If RQTY = 0 Then
> > MsgBox "Sales Order: " & SONUM & " " & Chr(10) & "Line: " & SOLINE
&
> > Chr(10) & "This line will not be process"
> > Exit Function
> > End If
> >
> > RText = "Sales Order: " & SONUM & " " & Chr(10) & "Line: " & SOLINE &
> > Chr(10) & "Ready to Process?"
> > Responce = MsgBox(RText, vbInformation + vbYesNo, cianame())
> > If Responce = vbYes Then
> > sqlString = "INSERT INTO PS_HST ( SONUM, SOLINE, QTY, SHIPPER,
> > SHIPDATE, SHIPTIME ) VALUES (" & SONUM & "," & SOLINE & "," & RQTY & ",
'"
> > &
> > dhGetUserName() & "', CURDATE ( ), CURTIME ( ))"
> > INSERT_SHP (sqlString)
> > sqlString = "SELECT COUNT(SONUM) AS SO FROM PS_SHP WHERE SONUM =
"
> > &
> > SONUM & " AND SOLINE = " & SOLINE
> > CurrentDb.QueryDefs("Server_GETTSHP").SQL = sqlString
> > If DLookup("[SO]", "Server_GETTSHP") = 0 Then
> > sqlString = "INSERT INTO PS_SHP ( SONUM, SOLINE, TSHP )
VALUES
> > (" & SONUM & "," & SOLINE & "," & RQTY & " )"
> > INSERT_SHP (sqlString)
> > Else
> > sqlString = "SELECT TSHP FROM PS_SHP WHERE SONUM = " & SONUM
&
> > "
> > AND SOLINE = " & SOLINE
> > CurrentDb.QueryDefs("Server_GETTSHP").SQL = sqlString
> > NQ = RQTY + DLookup("[TSHP]", "Server_GETTSHP")
> > sqlString = "UPDATE PS_SHP SET TSHP = " & NQ & " WHERE SONUM
=
> > "
> > & SONUM & " AND SOLINE = " & SOLINE
> > INSERT_SHP (sqlString)
> > End If
> > Else
> > End If
> > Else
> > End If
> > End Function
> >
> >
>
>
- Next message: Graham R Seach: "Re: Help with while ...loop Statements"
- Previous message: Benedict Appleby: "Recurring record entry"
- In reply to: Graham R Seach: "Re: Help with while ...loop Statements"
- Next in thread: Graham R Seach: "Re: Help with while ...loop Statements"
- Reply: Graham R Seach: "Re: Help with while ...loop Statements"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|