Thanks for the interset but I solved the problem myself. It seems I was supposed to load the DataEnviroment object then test the state of the recordset i was trying to update and if it was open I needed to close it. Then I updated the SQL and refreshed the report object.
The code I used was...
I'm creating a front end to a MS Access DB linked to a Ctree++ Db using VB. I want to create a report based on some selections the user checks on a form. For example the user selects the various types of services to be reported for and the report is supposed to show all the vendors who offer...
=DLookUp("[Cost per Metre]","MainTeesQ","[txtMainTcost] =" & [txtMainTcost])
This is wrong. the lookup function is used like this:
Dlookup(field1, table, field2 = value)
field1 - the field whose value you want to return
table - the name of the table/query the...
Try this code:
Private Sub ShowFreeSpace()
Dim fs, d, s
Dim drvPath as String
drvPath = "C:"
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " -...
Run this procedure:
Private Sub CreateLogFile()
Dim fs as Object
Dim a as Object
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
For index = 0 to list0.ListCount-1
a.writeline(list0.itemdata(index))
Next index
a.Close...
You should save the values to some table so that the options will be available every time the database is run.
Make the form based on the table and on closing the form update the table as necessary. When you open the form it will get the data from the table.
ntp
you could use DLookup to get the value.
Example, me.txtFieldValue = Dlookup
For a string value
("[FieldName]", "queryName", "[SomeField] ='" & Somevalue & "'")
For a numerical value
("[FieldName]", "queryName", "[SomeField]...
I noticed something in your last message
>>try to run it in the VBA Editor, it just comes up looking for the macro name.
Are you getting the same error when you open the form?
Your code should look like this -
Private Sub cboEmployeeID_AfterUpdate()
me.filter "[EmployeeID] = "...
yes you need to change Ocmbo0 to cboEmployeeID. I'm sorry I assumed you would have realised my code was only a sample that needed to be adapted to your variables. That is why you were getting the Macro problem. The interpreter did not know what combo0 was so it assumed it was some macro.
ntp
Your forms data source should be the Training table.
The combobox should be bound to the employeeId field and consist of three columns: employeeID, FName, LName.
You select an item from the combobox it returns the employeeid. the filter is applied to the form, all training records for the...
Your combobox afterupdate event might look like this:
Private Sub combo0_AfterUpdate()
me.filter "[EMPLID] = " & me.combo0
me.requery
End Sub
This is assuming your form has a specified data source with a field called EmplID. The filter will return all records with an...
Sounds like your report is taking very long to format itself so you have to wait a long time to actually view the output. Could be that you have a slow machine, little RAM, or extremely complex reports/subreports.
ntp
Manowar,
Send me a copy of the database with the table structures, and How you what calculations you need performed. I'll be able to better help you like that.
ntp
nparray@plipdeco.com
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.