Solved

VBasic 6.0 help

Posted on 2000-05-06
45
337 Views
Last Modified: 2008-03-03
my questions?

1)why will the right date that i enter on the credit card not print on my picture box receipt?and why will my account not print on my receipt either?? here is the code
Private Sub Cmd2_Click()


d = True
Month = Mid(lblDate.Caption, 1, 2)
If Mid(Month, 2, 1) = "/" Then Month = Mid(lblDate.Caption, 1, 1)
Year = Mid(lblDate, (Len(lblDate) - 1), 2)
txtmonth.Text = Month
txtyear.Text = Year
txtccnumber.Text = ccnumber

d = True
If d Then
Unload Form4
Form3.Show
End If

End Sub

Private Sub Form_Load()
lblDate = Date

2.)how do i get my Purchase order number to print on my receipt properly???here is the code...

Private Sub cmdCancel_Click()
Dim str As String

If Len(str) = 0 Then
MsgBox "user pressed cancel"
Else
MsgBox str
End If

End Sub

Private Sub cmdRec_Click()

Call PictureBox
Call PurchaseOrderNo



End Sub

Private Sub PurchaseOrderNo()
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
End Sub


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)


Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
Pic1.Print , "Month", Month, "Year", Year
Pic1.Print , "Order No.", p
End Sub



Private Sub tax()
Dim tax As Integer


If txtState <> MS Then
tax = 0
Else
If txtState = MS Then
tax = Price * 0.07
End If
End If

End Sub

Private Sub Form_Load()
lblDate = Date
End Sub

Private Sub optMast_Click()
If optMast.Value = True Then
Unload Form2
Form4.Show
End If
End Sub
0
Comment
Question by:Jenny30
  • 23
  • 12
  • 7
  • +2
45 Comments
 
LVL 6

Expert Comment

by:Marine
Comment Utility
Have you set the AutoReDraw Property to True ? See if it will help to show you the results.
0
 
LVL 6

Expert Comment

by:Marine
Comment Utility
of the picture box i meant.
0
 

Expert Comment

by:AZWolf7
Comment Utility
Here's what I see. Regarding #2, the picture box never gets the Order # value. To get it, you need to change a few things.

Question #1 is answered in the revised PictureBox routine. You never assigned values to your Month and Year variables. Declaring the "Option Explicit" at the beginning of all your code will prevent these type of errors, as it won't run until you declare all of your variables.

First, Do this:
Private Sub cmdRec_Click()
   Call PictureBox
   'we wil call this from within PictureBox
   'Call PurchaseOrderNo
End Sub
'Next, we change the PurchaseOrderNo to a function, because functions return values, subs do not
Private Function PurchaseOrderNo() as Integer
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
    PurchaseOrderNo = p
End Sub

'Next, we need to change PictureBox so it shows this value

Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum as Integer

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)


Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtMonth, "Year", txtYear
'Here's the change
PONum = PurchaseOrderNo()
Pic1.Print , "Order No.", PONum
End Sub







0
 

Author Comment

by:Jenny30
Comment Utility
ok,AZWolf7,I did what you said and it is still not printing my account number,right month and year,or my purchase order...any more suggestions??
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
what is going wrong?  your first part of the code is just fine...as long as you are declaring the variables somewhere

Dim month as string
Dim year as string
etc...
0
 

Author Comment

by:Jenny30
Comment Utility
ok this the code and what it looks like now...it still willnot print in my picture box...

Const Month As String = "Month"
Const Year As String = "Year"

Private Sub cmdCancel_Click()
Dim str As String

If Len(str) = 0 Then
MsgBox "user pressed cancel"
Else
MsgBox str
End If

End Sub

Private Sub cmdRec_Click()

Call PictureBox
Call PurchaseOrderNo



End Sub

Private Sub PurchaseOrderNo()
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
   PurchaseOrderNo = p

End Sub


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum As Integer


Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)


Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtmonth, "Year", txtyear
'Here's the change
PONum = PurchaseOrderNo()
Pic1.Print , "Order No.", PONum

End Sub



Private Sub tax()
Dim tax As Integer


If txtState <> MS Then
tax = 0
Else
If txtState = MS Then
tax = Price * 0.07
End If
End If

End Sub

Private Sub Form_Load()
lblDate = Date
End Sub

Private Sub optMast_Click()
If optMast.Value = True Then
Unload Form2
Form4.Show
End If
End Sub

0
 

Expert Comment

by:AZWolf7
Comment Utility
Yes, add a text box to your form with the picturebox, and call it txtPONum
then add a line to the PictureBox routine...

Then tell me what you see in txtPONum.
Also, tell me what values you see in
txtMonth and txtYear...


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum as Integer

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)


Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
Pic1.Print , "Month", txtMonth, "Year", txtYear
PONum = PurchaseOrderNo()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Order No.", PONum
End Sub
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Private Sub cmdRec_Click()

Call PictureBox

End Sub



Private Sub PurchaseOrderNo() As Integer
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
   PurchaseOrderNo = p

End Sub


0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
oops

Function PurchaseOrderNo() As Integer
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
   PurchaseOrderNo = p

End Function
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
you didnt need to call the purchaseorderno function in the command_click event because it was already called in your picuterbox sub routine.  then i changed the purchasorderno to a function that would return an integer since that is what you are trying to do
0
 

Expert Comment

by:AZWolf7
Comment Utility
Yes, add a text box to your form with the picturebox, and call it txtPONum
then add a line to the PictureBox routine...

Then tell me what you see in txtPONum.
Also, tell me what values you see in
txtMonth and txtYear...


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum as Integer

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)


Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
Pic1.Print , "Month", txtMonth, "Year", txtYear
PONum = PurchaseOrderNo()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Order No.", PONum
End Sub
0
 

Expert Comment

by:AZWolf7
Comment Utility
Go back and look at my first suggestion. Here is what you have:

Private Sub PurchaseOrderNo()
    Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
   PurchaseOrderNo = p

End Sub


Subs do not return values, Functions do. I am surprised this even runs. Change it to:
'-------------------------------------

Private FUNCTION PurchaseOrderNo() as Integer
'-------------------------------------

You are going to have the same problem with tax, so here's the change for that:

Private FUNCTION tax() As Single
Dim sTax As Single

If txtState <> MS Then
     sTax = 0
Else
    If txtState = MS Then
       sTax = Price * 0.07
    End If
End If
tax = sTax

End Sub
'The reason I changes it to single is that tax uses decimals, and you won't get any with an integer

'-------------------------------------


Next, you didn't change this routine:

Private Sub cmdRec_Click()
Call PictureBox
Call PurchaseOrderNo
End Sub
'-------------------------------------
Change it to this:
Private Sub cmdRec_Click()
    Call PictureBox
End Sub
'-------------------------------------


Now, if it still doesn't work, send us what values show up in txtMonth, txtYear, and txtPONum, and we should be able to figure it out from that...
0
 

Author Comment

by:Jenny30
Comment Utility
it will not let me run the program now...it tells me that"my type mismatches" at the top where i declared my Const...these are my changes so far...


Const Month As String = "Month"
Const Year As String = "Year"
Const PONum As Integer = "PONum"


Private Sub cmdCancel_Click()
Dim str As String

If Len(str) = 0 Then
MsgBox "user pressed cancel"
Else
MsgBox str
End If

End Sub

Private Sub cmdRec_Click()

Call PictureBox
Call PurchaseOrderNo



End Sub

Private Sub PurchaseOrderNo()
    Dim p As Integer
PurchaseOrderNo = p

End Sub


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum As Integer
Dim Month As String
Dim Year As String


Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)

'Here's the change
PONum = PurchaseOrderNo()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtmonth, "Year", txtyear

'>>> Add this line
txtPONum = PONum
Pic1.Print , "Order No.", PONum



End Sub


0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Const PONum As string = "PONum
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
why are you declaring that as a constant? you are declaring it again later in you PictureBox sub...do not declare PONum at the beginning at all

0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
and please change the PurchaseorderNo Sub to:


Function PurchaseOrderNo() As Integer
   Dim p As Integer
    p = Int(((5000 - 500 + 1) * Rnd) + 500)
   PurchaseOrderNo = p
End Function
0
 

Expert Comment

by:AZWolf7
Comment Utility
You don't need the constants. Constants are values that never change, not variables. Also, in declaring constants, you wouldn't need to declare the type. Forget the constants, you have these values declared as variables (which means the value can change) later on....
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
actually i dont see any reason to declare any of those constants at the top as you never use them.  since you actually type in the strings "Month" and "Year" later on it is not necessary to declare them as constants
0
 

Author Comment

by:Jenny30
Comment Utility
when i go to debug the project i can not get it to go past my splash screen

this is my whole program

----------------FORM1-------------------

Private Sub Form_Load()

End Sub

Private Sub Timer1_Timer()
Form2.Show
Unload Form1
End Sub
----------------------------------------


----------------FORM2-------------------

Private Sub Command1_Click()
   
   
   
   
End Sub

Private Sub Check1_Click()
    txtComment.Visible = True
End Sub

Private Sub cmdRum_Click()
   
    x = True
   
    Open "a:\music store.txt" For Input As #1
    Do While Song <> Combo1.Text
    Input #1, Song, Quantity, Price, Genre
    Loop
   
   
    If Song <> Combo1.Text Then
       MsgBox ("bet you wish I had it")
       x = False
    End If
   
    If txtQuantity > Quantity Then
     Prompt = "Sold Out"
       x = False
       
       Else
        If Option1.Value And Genre = "Tape" Then
        strPrompt = "Not available as CD"
        x = False
            Else
             If Option2.Value And Genre = "CD" Then
             strPrompt = "Not available as Tape"
             x = False
       End If
         If strPrompt <> vbNullString Then MsgBox strPrompt
               
                If x Then
                Unload Form2
                Form3.Show
                End If
           End If
        End If
   
     
         
     Close #1
End Sub
----------------------------------------


-------------------FORM3----------------

Const Month As String = "Month"
Const Year As String = "Year"



Private Sub cmdCancel_Click()
Dim str As String

If Len(str) = 0 Then
MsgBox "user pressed cancel"
Else
MsgBox str
End If

End Sub

Private Sub cmdRec_Click()
    Call PictureBox
    Call tax



End Sub

Private Function PurchaseOrderNo() As Integer

    Dim p As Integer
PurchaseOrderNo = p

End Function


Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum As Integer
Dim Month As String
Dim Year As String


Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)

'Here's the change
PONum = PurchaseOrderNo()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
Pic1.Print , "Account", ccnumber
'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtmonth, "Year", txtyear

'>>> Add this line
txtPONum = PONum
Pic1.Print , "Order No.", PONum



End Sub



Private Function tax() As Single
Dim sTax As Single

If txtState <> MS Then
     sTax = 0
Else
    If txtState = MS Then
       sTax = Price * 0.07
    End If
End If
tax = sTax



End Function

Private Sub optMast_Click()
If optMast.Value = True Then
Unload Form2
Form4.Show
End If
End Sub
----------------------------------------

----------------FORM4-------------------

Private Sub Cmd1_Click()
If Len(txtccnumber.Text) = 16 Then MsgBox "Credit Good"
End Sub

Private Sub Cmd2_Click()


d = True
Month = Mid(lblDate.Caption, 1, 2)
If Mid(Month, 2, 1) = "/" Then Month = Mid(lblDate.Caption, 1, 1)
Year = Mid(lblDate, (Len(lblDate) - 1), 2)
txtmonth.Text = Month
txtyear.Text = Year
txtccnumber.Text = ccnumber

d = True
If d Then
Unload Form4
Form3.Show
End If

End Sub

Private Sub Form_Load()
lblDate = Date
End Sub
----------------------------------------

----------------MODULE------------------

Public x As Boolean
Public Song As String
Public Quantity As Integer
Public Price As Integer
Public Genre As String
Public strPrompt As String
Public Month As String
Public Year As String
Public d As Boolean

0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
is your timer enabled?  be sure timer1.enabled = true before you run it
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
'Remove these

------------------------------------
Const Month As String = "Month"
Const Year As String = "Year"
------------------------------------


There is no string in str here, I assume you were taking my advice about the Inputbox from last time, you still need to call the inputbox for this sub to do anything

------------------------------------
Private Sub cmdCancel_Click()
Dim str As String

If Len(str) = 0 Then
MsgBox "user pressed cancel"
Else
MsgBox str
End If

End Sub

-------------------------------------
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Also I see you have 'Month' and 'Year' declared as Public variables in your Module...if you ever declare variables as Public in a Module, then you can not declare them again in your forms.  So remove your declarations of those variables in your Picturebox sub routine.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Expert Comment

by:AZWolf7
Comment Utility
One thing I noticed is this routine is wrong now:

You have:
'----------------------------------
Private Function PurchaseOrderNo() As Integer

    Dim p As Integer
PurchaseOrderNo = p

End Function
'----------------------------------
You deleted the line which does the work
Private Function PurchaseOrderNo() As Integer

    Dim p As Integer
p = Int(((5000 - 500 + 1) * Rnd) + 500)
PurchaseOrderNo = p

End Function
   
Next, you have corrected tax, but it doesn't do anything. What do i mean? Well, it returns the tax value, but nothing uses it.
So here is a changed Picture Box routine
'----------------------------------
Private Sub PictureBox()
Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum As Integer
'>>>>> Get rid of these, not needed
'Dim Month As String
'Dim Year As String
'>>>> Add this
Dim sTax as Single

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)

'Here's the change
PONum = PurchaseOrderNo()
'>>>>>>> Add this
sTax = tax()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
'>>>>> Add this
Pic1.Print, "Tax", sTax
Pic1.Print , "Account", ccnumber


'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtmonth, "Year", txtyear

txtPONum = PONum
Pic1.Print , "Order No.", PONum

End Sub
'------------------------------------

Now you don't need to change the following routine, because the tax call is not needed:

Private Sub cmdRec_Click()
    Call PictureBox
    'Get rid of this
    'Call tax
End Sub


0
 
LVL 14

Expert Comment

by:wsh2
Comment Utility
Month and Year are VB Keywords.. change your CONST variable names to:

Const strMonth as String = "Month"
Const strYear as String = "Year"

and everywhere you use the variables.

0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
i agree the naming convention isnt good but it doesnt matter since shes not ever using the vb keywords in her program
0
 

Author Comment

by:Jenny30
Comment Utility
ok here is my data file

"My baby drives a Fisher price 4x4",5,39.95,"CD"
"Instant Cornbread Blues",3,47.00,"CD"
"Early to bed,early to rise,early to class,yeah...whatever",12,21.95,"Tape"
"Huntin,Fishin,and 4-wheelin...woohoo!!",7,20.00,"CD"
"Sweatin in da Kitchen",0,115.95,"Tape"
"Robert,O Robert, why didn't we retire?",5,33.50,"Tape"
"Leather and Chains",0,55.10,"CD"
"If it aint gotta heel,then it aint called a shoe",11,125.00,"Tape"
"Doing the twist...Microsoft style",1,5.32,"CD"

my price in the picturebox rounds off to the nearest dollar Ex:39.95 reads as 40$ in my pictureBox

the Purchase order works now but the Tax comes up as 0 and it is still blank at my month,year and account number...
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
the Price is rounded because you declare it in your module as an Integer.  change it to:

Public Price As Single
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
in your tax function you have if txtState <> MS

I assume you want to compare the text values...

use txtState <> "MS"
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Private Sub Cmd2_Click()

'DECLARE STRINGS HERE -  DO NOT DECLARE THEM IN YOUR MODULE

Dim Month,Year As String

d = True
Month = Mid(lblDate.Caption, 1, 2)
If Mid(Month, 2, 1) = "/" Then Month = Mid(lblDate.Caption, 1, 1)
Year = Mid(lblDate, (Len(lblDate) - 1), 2)
txtmonth.Text = Month
txtyear.Text = Year

'WHERE IS ccnumber COMING FROM??  EITHER DECLARE IT IN THIS FUNCTION OR MAKE IT GLOBAL AS WELL BY PUTTING IT IN YOUR MODULE

txtccnumber.Text = ccnumber

d = True
If d Then
Unload Form4
Form3.Show
End If

End Sub

0
 

Author Comment

by:Jenny30
Comment Utility
my tax, ccnumber,month, and year will still not print on my receipt...i did everything that you told me to do but it will not anything.My price is right though...hey at least that works properly...

Dim Name As String
Dim Street As String
Dim City As String
Dim State As String
Dim Zip  As Integer
'Add a PONumber variable
Dim PONum As Integer
'>>>>> Get rid of these, not needed
'Dim Month As String
'Dim Year As String
'>>>> Add this
Dim sTax As Single

Name = txtName
Street = txtStreet
City = txtCity
State = txtState
Zip = Val(txtZip)

'Here's the change
PONum = PurchaseOrderNo()
'>>>>>>> Add this
sTax = tax()
'>>> Add this line
txtPONum = PONum
Pic1.Print , "Song", Song
Pic1.Print
Pic1.Print , "Name", Name
Pic1.Print , "Street", Street
Pic1.Print , "City", City
Pic1.Print , "State", State
Pic1.Print , "Zip Code", Zip
Pic1.Print
Pic1.Print , "Price", Price
'>>>>> Add this
Pic1.Print , "Tax", sTax
Pic1.Print , "Account", ccnumber


'Here is the change to get the Month and Year to print
Pic1.Print , "Month", txtmonth, "Year", txtyear

txtPONum = PONum
Pic1.Print , "Order No.", PONum



End Sub



Private Function tax() As Single
Dim sTax As Single

If txtState <> "MS" Then
     sTax = 0
Else
    If txtState = MS Then
       sTax = Price * 0.07
    End If
End If
tax = sTax

0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
what is your receipt anyways? i see you keep using the .Print method but I'm not sure what control you are using for that.  what is Pic1?
0
 

Expert Comment

by:AZWolf7
Comment Utility
It's a picture box....
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
thats what i dont get...picturebox doesnt have a print method
0
 

Author Comment

by:Jenny30
Comment Utility
Pic1 is a picture box...all my credit card information is on Form 4 but when i validate it, i need it to print in the picturebox on Form 3...

0
 

Author Comment

by:Jenny30
Comment Utility
what do you mean by picture box not having a print method...all my other data is printing perfectly fine inside of the picture box...by the way i am not being sarcastic even though it sounds that way...
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
sorry, i'm not much of a picturebox user and it isnt documented in msdn as a method for the picturebox...i apologize of my sad ignorance
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
your Picturebox sub routine is called in Form3. If you need to access information from things you calculate in Form4, then make those variables public by declaring them in your Module
0
 

Author Comment

by:Jenny30
Comment Utility
ok, i declared them in my module, but when i go to form 4 and enter my credit card information, it puts in todays date instead of the month and year that i use as an expiration date and it will still not display my account number...
are you tired of my questions yet???
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
are Month and Year still declared globally in your module?  
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 200 total points
Comment Utility
where does ccnumber come from?  by the looks if it, he should be declared globally as well.
0
 

Author Comment

by:Jenny30
Comment Utility
ccnumber is my txtccnumber...this is where the user enters their credit card number and the Month and year is where they eneter their expiration date...
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
as long as ccnumber and month and year are all declared in your module they should be ok...the thing with ccnumber is all i see is this:

txtccnumber.Text = ccnumber


if the user is entering this information then it should be the other way around.  after clicking some button you will set ccnumber to what they typed in:

ccnumber = txtccnumber.text

and if it is declared globally you can now access it from any form
0
 

Author Comment

by:Jenny30
Comment Utility
ok, it works,yea!!!Thank you so much!!! i wish i could give everyone an "A" that helped me...if their is a way than let me know...
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
you can post another question that says "points for AZWolf7" and give him points as well.  glad you got it working =)
0
 

Author Comment

by:Jenny30
Comment Utility
ok, i will do that
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now