borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Access 2007 VBA) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : vba code in MSAccess
Poster Message
bhorwitz
Level: Trainee

Registered: 06-09-2008
Posts: 1

icon vba code in MSAccess

I need a code to run in a query to give me box X of X. For example.
Id           description          total boxes       Box X of X
1             test 1                3                      Box 1 of 3
1             test 2                3                      Box 2 of 3
1             test 3                3                      Box 3 of 3
2             test 4                2                      Box 1 of 2
2             test 5                2                      Box 2 of 2    

I can get the total boxes in the query by grouping and counting, but I cant get the Box x (Box X of X). I need to write the Box X of X to a table.

06-09-2008 at 09:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 542
icon Re: vba code in MSAccess

Try this:

Dim strIN As String
Dim intBox As Integer

strIN = "Box 2 of 3"
intBox = CInt(Trim(Mid$(strIN, 4, InStr(1, strIN, "of") - 4)))



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

10-09-2008 at 10:44 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : vba code in MSAccess
Next Topic (Access 2007 VBA) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder