I'm going to dazzle you with my technical prowess here ...
It's an ActiveReport ... it just prints/outputs the data ... (yeah, profound right? haha).
My knowledge is limited to the fact that you just kind of point/link the field(s) in the report design to the appropriate field in the database...
In my COMPARE_REC table on the SQL Server side there are 5 records.
The reports should resemble (these figures obviously don't add-up) :
Dept FY04XP FY05XP FY06XP
ABC 123.45 234.56 345.67
BCD 456.78 567.89...
...Set Conn = New ADODB.Connection
'define the recordset access statement
Dim strSQL As String
strSQL = "SELECT * FROM COMPARE_REC"
Set rs = New ADODB.Recordset
Conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security...
Thanks for your responses ... I just got back from my vacation last night (5/25 - 6/2 - as you can image I'm exhausted ... not that anyone cares!).
In any case, Jerry's explanation is correct ... the problem is that there will be multiple records that do have the same remark (my search field)...
...to the database.
Set Conn = New ADODB.Connection
'define the recordset access statement
Dim strSQL As String
strSQL = "SELECT * FROM Expense ORDER BY ExpenseID"
Set rs = New ADODB.Recordset
On Error GoTo Err_Exit
Conn.ConnectionString =...
I'm trying to extract the info from the SQL server. The query on the SQL side is kind of huge so here's a small piece of it:
SELECT
dbo.ALLOCATED.*, dbo.OBLandEXPD.*,
dbo.ALLOCATED.SumOfASal * .4344 AS SE_ASal,
dbo.ALLOCATED.SumOfASal * .5656 AS RE_ASal,
dbo.ALLOCATED.SumOfAAwd * .4344 AS...
I have multiple records grouped by Branch which rolls all records in the "View table" up into 5 records(again grouped by Branch).
When I used the DAO control I was able to generate one report with all 5 branches (on separate pages) with:
Private Sub ghBranch_Format()
ghBranch.NewPage =...
I hope I can explain the issue I'm having suffiently ... in any case here it is:
I connected to the SQL server successfully but I'm having problems generating my reports anyway. And I suspect it's due to the & "" below ... but if I remove them I get an error too.
Field1.DataValue =...
How can I find a record in a recordset (connected to the SQL Server via code)
I modified my code to look like:
Private Sub List1_Click()
Dim Template As String
Template = "[ERemark] = " & Chr$(34) & List1.List(List1.ListIndex) & Chr$(34)
rs.Find Template
End Sub
Result: the list was blank...
Thanks George it worked.
However, I find that if I stop on say record #25 and I edit it and save it and then move to another record before I close the app ... record #25 is saved twice deleting the immediate record in the direction in which I moved after I saved record #25 (I hope I explained...
Now I can see the first record only and I can edit that record only.
Anybody know how I can move to the subsequent records?
I added the following code to my Form_Load():
With rs
cboABranch.Text = !ABranch
cboASuppliesType.Text = !ASuppliesType & ""
txtASal.Text =...
Thanks JerryKlmns that worked.
I can update (add new records) the database on the SQL Server side now.
Now I need to figure out how to edit, navigate and generally maintain the records ... since I can't see them when I load the application.
Thanks gmmastros & JerryKlmns for responding.
Now I *have a connection but I cannot see any of the current records in the database (hence I cannot edit or update the records).
*However everytime I try to add a new record on the VB side - I see a new record on the SQL side but it's an empty...
...'RecNav.MoveLast
rs.MoveLast
End Select
End Sub
Private Sub Form_Load()
'Me.WindowState = vbMaximized
'**********************************************
'Set and make the connection to the database.
Set Conn = New ADODB.Connection...
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.