Posts by gollem
-
-
Re: Connect To As400 And Export Data
Hi,
it's a little mix you've made I think.
Here's a basic structure:Code
Display Moredim conn as adodb.connection dim rstSQL as adodb.recordset set conn = new adodb.connection set rstsql =new adodb.recordset conn.provider ="....." conn.connectionstring ="c:\tmp\......" conn.open rstsql.open "SELECT * from tblData",cnn,adopendynamic, adlockoptimistic do while rstsql.eof = false rstsql.movenext loop rstsql.close set rstsql = nothing conn.close set conn=nothing
Hope this helps.
-
Hello everybody,
since a week I use Excel2003 and I've noticed something strange.
When I open a file in excel and I close it without closing excel-application, the file remains open in the Vba-background.This is not a big problem but when I reopen the file I get 2 versions in the Vba-explorer. This continues until I close the whole excel-application. So everytime I reopen the file the vba-explorer adds a new version...
Is somebody familiar with this? Is this normal or is this a bug?
Thanks for the feedback.
Gollem
-
-
Re: Removing List 2 from List 1 ( and putting into new place)
Books, internet and trying it out yourself.
-
Re: Removing List 2 from List 1 ( and putting into new place)
Here's an attachement with a VBa example
Hope this is what you seek. -
Re: Removing List 2 from List 1 ( and putting into new place)
Can you be more specific, what are you trying to do. Do you want to search a value in a column and remove all duplicates??? More info is needed.
-
Re: Populating combobox
Glad I could help
-
Re: Populating combobox
Hi,
this should do the trick, check the example attached.
Code
Display MorePrivate Sub UserForm_Activate() Dim lngRow As Long Dim intIndex As Integer UserForm1.ComboBox1.Clear 'Clear combobox lngRow = 2 'Start searching on row 2 Do While ActiveSheet.Range("A" & lngRow).Value <> "" 'Read until empty col A 'Check if item already exists For intIndex = 0 To UserForm1.ComboBox1.ListCount - 1 If UserForm1.ComboBox1.List(intIndex) = ActiveSheet.Range("A" & lngRow).Value Then GoTo NextRow End If Next intIndex UserForm1.ComboBox1.AddItem ActiveSheet.Range("A" & lngRow).Value NextRow: lngRow = lngRow + 1 Loop End Sub
-
Re: Populating combobox
Yes this is possible,
but you should'nt use the manual entries additem "..."
You should write a little program that adds all values of col A. I'll take a look at it and post back to you
-
Re: Populating combobox
Hi,
I'm not sure what the problem is. If you add a new item, you can always refresh or reload your code to populate the combobox.
-
Re: Printing access report with VB
I'll test it when I have my new Access version.
-
Re: Printing access report with VB
Tried it and got the same message. The Access object doesn't have a printer method. Good thinking :smile:
-
Re: Printing access report with VB
Like I said in previous post:
QuoteCarl,
the debugger doesn't know the method printers...
VBA:
... = objAccess.Printers(1)error: unknow method....
Anyway I found a solution that could work for me, I've specified a printer in the report of access. So If somebody prints that report with my program, the report is always printed on the specified printer.
Thanks again for the replies.
-
Re: Printing access report with VB
Perhaps it's a problem because I have Access2000 and you have a higher version...
-
Re: Printing access report with VB
Ok,
that will be the problem I guess, I have only 9.0.Thanks anyway for the reply Carl.
-
-
Hi,
I want to print an access report with VB6.0. This works fine the only problem I have is that I can't seem to define the printer to print on, it always prints on the same printer. Somebody has any idea how to do this?
Here's the code I have:
Code
Display MoreDim objAccess As Access.Application Dim prt As Printer For Each prt In Printers If prt.DeviceName = "\\...\printer" Then Exit For End If Next prt Set Printer = prt Set objAccess = New Access.Application objAccess.OpenCurrentDatabase "\\...\db.mdb"" objAccess.DoCmd.OpenReport ("rpt") objAccess.Application.Quit Set objAccess = Nothing Set prt = Nothing 'MsgBox "List printed.", vbOKOnly + vbInformation, "Message" End
-
Re: Print worksheets based on information in column
Try the code in the attachement.
-
Re: Combo Box - AfterUpdate
Perhaps this is what you seek.