Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 03:06 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jgcvasquez Send a message via Yahoo to jgcvasquez
Default currency codes

Hi! Please help me to display currency in the text box ($999,999,99) when running the application and in printing? What code I will us. Please give me sample codes. Thanks

jgcv
 
Old February 25th, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

use:

format(text1.text,"currency")



Gonzalo Bianchi
 
Old February 26th, 2004, 02:13 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jgcvasquez Send a message via Yahoo to jgcvasquez
Default

Thanks

jgcv
 
Old February 28th, 2004, 02:33 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jgcvasquez Send a message via Yahoo to jgcvasquez
Default

Dear Friend,

I tried the code that you send and I cog an error in it. Here is my code file

Form Zurf '
'By JGCV '
'Date Nov. 13, 2003 '
'==============================================='
Dim Conn As ADODB.Connection
Dim Comm As ADODB.Command
Dim rsZurf As ADODB.Recordset
Dim msg As String
Dim answer As String
Dim lngNum As Long

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    'open connection
    Set Conn = New ADODB.Connection
        Conn.CursorLocation = adUseClient
        Conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=Zurf;Data Source=MOV"

    'open table thru recordset
    Set Comm = New ADODB.Command

    Set rsZurf = New ADODB.Recordset
        rsZurf.Open " Select * From Item order by ItemNo ", Conn, adOpenStatic, adLockOptimistic

    'populate datagrid
    Set dbgItems.DataSource = rsZurf

    'DisableTextBoxes



End Sub
Private Sub cmdAdd_Click()
    If cmdAdd.Caption = "Add" Then
        cmdAdd.Caption = "OK"
        cmdEdit.Enabled = False
        cmdDelete.Enabled = False
        cmdCancel.Enabled = True

        EnableTextBoxes
        InitializedTextBoxes
        txtItemNo.SetFocus
    Else
        With Comm
            .ActiveConnection = Conn
        Conn.CursorLocation = adUseClient

            .CommandText = "AddItem"
            .CommandType = adCmdStoredProc
            .Parameters.Append .CreateParameter("ItemNo", adChar, adParamInput, 10, txtItemNo.Text)
            .Parameters.Append .CreateParameter("Descriptions", adVarChar, adParamInput, 30, txtDescription.Text)
            .Parameters.Append .CreateParameter("Price", adInteger, adParamInput, 10, txtPrice.Text) '("currency")
            .Execute
            rsZurf.MoveNext


            rsZurf.Requery


            'RestoreCommandBottonAdd
            Call RCBA

            Set Comm = Nothing

        End With

     End If

End Sub


Public Sub InitializedTextBoxes()
    txtItemNo.Text = ""
    txtDescription.Text = ""
    txtPrice.Text = ""

    'initialize maskeeditbox
    'mskDateEnd.Mask = ""
    'mskDateEnd.Text = ""
    'mskDateEnd.Mask = "##/##/####"
End Sub

Public Sub RCBA()
    cmdAdd.Caption = "Add"
    cmdAdd.Enabled = True
    cmdEdit.Enabled = True
    cmdDelete.Enabled = True
    cmdCancel.Enabled = True
End Sub

Public Sub EnableTextBoxes()
    txtItemNo.Enabled = True
    txtDescription.Enabled = True
    txtPrice.Enabled = True
End Sub

Can you please help me, is it my code wrong but when I run it run perfectly. I’m using SQL for the data base.

Hope you can help me. Thanks


jgcv





Similar Threads
Thread Thread Starter Forum Replies Last Post
Currency Format kdkcchoco ASP.NET 1.0 and 1.1 Professional 1 March 29th, 2007 08:13 AM
Currency mjbkelly Beginning VB 6 1 March 22nd, 2007 07:14 AM
Currency Format heerajee Pro PHP 2 June 5th, 2006 02:24 AM
currency manager zouky ADO.NET 2 December 12th, 2005 05:20 AM
Formatting currency chelechele JSP Basics 0 April 5th, 2005 06:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.