I am not able to reproduce your problem. I did the following test on the mouse up event of list box 2 with no problems:
Private Sub lstBox2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox lstBox1 & " " & cbx1 & " " & cbx2
End Sub
The overflow error usually indicates that an integer variable has exceeded 32,767. The following code for the OnClick event of a button will cause this error. You can set a breakpoint on the Resume line. When the error occurs you can examine the value of your variables to determine which...
You can use the Column property to examine the contents of a column in a listbox. Like this
ListBoxName.Column(Index, Row)
Index is the zero based column number
Row is the optional zero based row number
ListBoxName.Column(1, 4) will return the value from the second column...
I think that this is what you are asking for:
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim strSQL As String
Set db = CurrentDb
Set tdf = db("myTable")
Set fld = tdf.CreateField("AmountEnd", dbDouble)...
In order to reference the text property of a control, the control must have focus. This should work:
If cboMath1PF = "N" Then
txtMathSkills = "No Active Record"
.
.
.
You can call the function from a query, from the control source of a form, from another module, etc.
From a query
SELECT CompanyName, NextInvoiceNumber(CompanyName) as NewInvoiceNum FROM myTable
Add the following code to the On Format event of the detail section of your report.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If YesNoField Then
txtCustomer.FontBold = True
Else
txtCustomer.FontBold = False
End If
End Sub
If you use single quotes as the text delimiter, use the following:
Dim strSQL As String
Dim strComment As String
strComment = Replace(txtComment, "'", "''")
strSQL = "Update tblComments Set Comment = '" & strComment & "' WHERE key = 'a';"
CurrentDb.Execute...
Place this code in a module. Note correction in DMAX parameters.
Function NextInvoiceNumber(NewlyAddedCompanyName as string) as integer
dim varLastInvoiceNum as variant
dim InvoiceNumber as integer
varLastInvoiceNumber = DMAX("InvoiceNumberField", "TableName", "CompanyNameField...
I think that you really want to increment the last invoice number that was used for a company.
dim varLastInvoiceNum as variant
varLastInvoiceNumber = DMAX("CompanyNameField", "TableName", "CompanyNameField = '" & NewlyAddedCompanyName & "'")
if isnull(varLastInvoiceNum) then...
In the Current event on the subform you can do something like this
textbox1 = field1
If textbox1 is on the main form then try this
Parent![textbox1] = field1
There needs to be a space between CommentXREFQuestionnaire and the VALUES keyword. Add a space after CommentXREFQuestionnaire and before the closing quote.
strSQL = "INSERT INTO CommentXREFQuestionnaire " & _
"VALUES(""28"", ""E"", ""2"");"
The problem is in this line near the top of the function:
cents = Right(dblValue, 2)
Replace it with
cents = (dblValue - Fix(dblValue)) * 100
The Right() function converts dblValue to string first then takes the right most two characters. The value of 100.10 is converted to a string...
Set up your list box as follows
Row Source Type: Value List
Row Source: 0;none;1;complete;2;incomplete
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
This will cause the number value to be saved in your table but the text values will be displayed in the list box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.