A
Ann
I'm not a programmer but can alter code I find. I have the following code in
an "On Not In List" event:
Private Sub cboFirstClassPostageRate_NotInList(NewData As String, Response
As Integer)
Dim intResponse As Integer
MsgBox "New First Class Postage Rate: '" & NewData & "'"
If MsgBox("The First Class Postage Rate you've entered '" & NewData & "'
is not in the First Class Postage Rate list." & vbCrLf & vbCrLf & _
"Do you want to add this First Class Postage Rate to the list?",
vbQuestion + vbYesNo) = vbYes Then
'We're going to add this First Class Postage Rate to the First Class
Postage Rate table.
Call basFirstClassPostageRates.AddFirstClassPostageRate(NewData)
'Signal that we have added this First Class Postage Rate.
intResponse = acDataErrAdded
Else
'Signal that we don't want to add this First Class Postage Rate.
intResponse = acDataErrContinue
End If
Response = intResponse
End Sub
It calls:
Public Function AddFirstClassPostageRate(curFirstClassPostageRate As String)
Dim strSQL As String
'Build the SQL to add the First Class Postage Rate to the table.
'Finished SQL looks like this:
'INSERT INTO tblFirstClassPostageRates (curFirstClassPostageRate)
strSQL = ""
strSQL = strSQL & " INSERT INTO tblFirstClassPostageRates
(curFirstClassPostageRate)"
strSQL = strSQL & " SELECT '" & curFirstClassPostageRate & "' ; "
'Run the SQL to add the person.
CurrentDb.Execute strSQL
End Function
The problem is that this is for a string and the field I'm trying to enter
the new data into is currency. How do I format this, or change to code so it
accepts the data without having to type everything. Example: I have to type
$0.45 and I only want to type .45 but have it appear in the table as $0.45.
Thanks for any help you can give me.
an "On Not In List" event:
Private Sub cboFirstClassPostageRate_NotInList(NewData As String, Response
As Integer)
Dim intResponse As Integer
MsgBox "New First Class Postage Rate: '" & NewData & "'"
If MsgBox("The First Class Postage Rate you've entered '" & NewData & "'
is not in the First Class Postage Rate list." & vbCrLf & vbCrLf & _
"Do you want to add this First Class Postage Rate to the list?",
vbQuestion + vbYesNo) = vbYes Then
'We're going to add this First Class Postage Rate to the First Class
Postage Rate table.
Call basFirstClassPostageRates.AddFirstClassPostageRate(NewData)
'Signal that we have added this First Class Postage Rate.
intResponse = acDataErrAdded
Else
'Signal that we don't want to add this First Class Postage Rate.
intResponse = acDataErrContinue
End If
Response = intResponse
End Sub
It calls:
Public Function AddFirstClassPostageRate(curFirstClassPostageRate As String)
Dim strSQL As String
'Build the SQL to add the First Class Postage Rate to the table.
'Finished SQL looks like this:
'INSERT INTO tblFirstClassPostageRates (curFirstClassPostageRate)
strSQL = ""
strSQL = strSQL & " INSERT INTO tblFirstClassPostageRates
(curFirstClassPostageRate)"
strSQL = strSQL & " SELECT '" & curFirstClassPostageRate & "' ; "
'Run the SQL to add the person.
CurrentDb.Execute strSQL
End Function
The problem is that this is for a string and the field I'm trying to enter
the new data into is currency. How do I format this, or change to code so it
accepts the data without having to type everything. Example: I have to type
$0.45 and I only want to type .45 but have it appear in the table as $0.45.
Thanks for any help you can give me.