the mismatch error is becasue I failed to realize that the Employee ID is in a numerical format so your code should now look as follows:
Private Sub lstEmployee_DblClick(Cancel As Integer)
Dim intEmployeeID As Integer
intEmployeeID = Me.lstEmployee.Value
DoCmd.OpenForm...
Hello Karl. Your problem is quite common. I will assume that the value that is stored in the listbox control has a primary key value. So the value '01' would be for the employee name Jamie Bates. When you douleClick over the listbox control it returns a value. Store that value in a...
From in the click event of your delete control, you will need to capture the record that was selected. In order to do that, you will need to create a variable. You will also need a variable to delete the record using a SQL statement. For example:
Sub cmdDelete_Click()
Dim intValue As Integer...
My students always get that problem. They attempted to create the buttons more than once giving it the same name based on the same event. VB nor VBA allows for buplicate control names on the same form/dialog. Press Alt+F11 to get the VBE and remove one of the event procedures
Sub...
Use the Forms Open Method and set the ApplyFilter property to Null
Sub Form_Open()
Me.ApplyFilter=""
End Sub
God Bless!
Jamie
http://nj.devry.edu/~jbates
Lonnie gives a best practise recommendation. He is totally correct. The way you are collecting the data is problematic. This would require that you first change the structure of your database. In the meantime, you will want to create a recordset loop to determine the number of records that...
The problem is with your declaration. Microsoft Access support ADO and DAO. You now must specifiy the recordset you want to work with.
Dim MyDb as DAO.Database
Dim MySet as DAO.Recordset
Set MyDb = CurrentDB
Set MySet = MyDb.Openrecordset("YourQueryName", DB_OPEN_DYNASET)...
I do not think the above reply answers your question. Below I have some example code that tells me how many records there are in a table named tblMember. I am using DAO. So you will have to make a library ink to the DAO library in order for this to work. Simply replace the table name...
The Information Property is used to return most most if not all of the information found in the Stats dialog. the example line of code returns the exact line number where my insertion point is:
Dim intStart as Integer
intStart = Selection.Information(wdFirstCharacterLineNumber)
To determine...
I do not think that your code is the problem. I would consider boosting your hardware a little. Code takes very little space. If you would like, I can review your code for you. Simply copy and paste it in the next thread.
Jamie
http://nj.devry.edu/~jbates
... use PathName to return the directory location of the workbook, use the name property to return the name of the workbook, use the FullName property to return the path and name of the workbook.
Jamie
PathName is not a variable. It is a property of the workbooks object collection and it is used to return the path anf file name of the workbook in question. for example:
sub mcrTest
Dim strPath as string
strPath = activeworkbook.pathname
msgbox strPath
end sub
Jamie 'DeVry'
... or if you know vba programming, you code use the following code
for each cell in selection
cell = cell * 1
Next
or
Do Until ActiveCell = ""
Activecell = Activecell * 1
ActiveCell.Offset(1,0).select
Loop
either loop should work for you if applied appropriately
Jamie...
Since the data was downloaded from a database, Excel will treat all values as text. the solution i used to use was that i placed the value 1 next to each each value that i wanted to update as numeric, then i multiplied it by copying a using paste special and choosing to multiply the numeric...
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.