Multiple Selects
If I am populating many different controls all with different tables within the same database do I need to have multiple rs and cn statements
ie.
Private adoRS As ADODB.Recordset Private cn As ADODB.Connection Private adoRS2 As ADODB.Recordset Private cn2 As ADODB.Connection Private adoRS3 As ADODB.Recordset Private cn3 As ADODB.Connection
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Case Multiple Selects
hi folks,
want to know what's the correct synax for the case statement if i want to put in multiple select attributes... e.g.
select case a, b, c
case 1:
'do this
case 2:
'do that
end select
does the above case statement work for attributes b and c at the same time? I tried but seems a bit wierd. some cases, not executed.
regards
Multiple Row Selects In DBGrid Control
Hello,
How can i select multiple rows in a DBGrid.
I am using the DBGrid to display the results from a access query.
Now i want to print the user selected records.
How can i accomplish this.
Thanx and best wishes
Gopal
Using Sub Selects With Access
I am used to writing select statements in SQL Server and I can write a select statement like
Code:
SELECT * FROM
(
SELECT Member.Number, Member.Balance AS CurrentBalance
FROM Member
WHERE Member.BalanceType = 'Current'
) AS Current
FULL JOIN
(
SELECT Member.Number, Member.Balance AS SavingsBalance
FROM Member
WHERE Member.BalanceType = 'Savings'
) AS Savings
WHERE CurrentBalance > SavingsBalance ;
Is there any way of doing the same thing in Access, and if so how?
Timing Selects
Hi.
I'm doing a college work in wich I need to determine the difference between indexed and non-indexed databases (Oracle).
To do so, I created a non-inexed database with 2 tables and then, added 1000000 lines in one and 3000000 in the other. Now, I created a program in VB to apply a simple select in one of the tables and determine the time that the pc took to read all registries. However, the time is to small... Many times, it returns 0.
Here's the command button that does it...
Code:
Private Sub Command1_Click()
Dim consulta, strExecucao As String
Dim i As Integer
Dim inittime As Double
Dim endtime As Double
Dim intervalo As Double
Set conexao = New ADODB.Connection
conexao.ConnectionString = "DSN=ODBCFILIPE;UID=FILIPE;PWD=FILIPE;"
conexao.Open
inittime = Timer
conexao.Execute ("Select * from Tab1R;")
endtime = Timer
intervalo = endtime - inittime
Text1.Text = intervalo
conexao.Close
End Sub
I think that VB executes the select and before the server finishes reading all table, it advances to the endtime...
If anyone can help...
Thanks.
Looping Without .Selects/.Activates
I've got a small problem with the below For/Next loop code. It works fine except when I take the selects out (like in this example).
I cant get it to drop down to the next cell in the range and process it.
Does anyone have a direction to point me in? This is the last set of selects in the utiliy and I would love to be able to remove them.
- Brad
Code:
'---- Roll 1D100 for all of the R&D Projects found -----------------------'
General.xlWst.Columns("G:G").ColumnWidth = 8 '
General.xlWst.Columns("I:I").HorizontalAlignment = xlCenter 'Center justify the Bonuses column for easier reading
General.xlWst.Columns("J:J").HorizontalAlignment = xlCenter 'Center justify the Roll column for easier reading
General.xlWst.Columns("K:K").HorizontalAlignment = xlLeft 'Left justify the Results column for easier reading
General.xlWst.Columns("K:K").ColumnWidth = 18 'Set the R&D Results column to 131 pixels
'
Set h = General.xlWst.Range("A:A").Find("RPs To-Date") 'Search for the word "RPs To-date" on the Economics worksheet and select it
y& = Right(h.Address(False, False), 2) 'Parse the number from the cell
LastRow& = General.xlWst.Range("d65536").End(xlUp).Row 'Finds the last Row Number
x& = LastRow& - y& 'Figure out how many projects there are
aa = "D" & y& '
bb = "C" & General.xlWst.Range(aa).Row 'Concat the C Column number with the cell number
cc = "D" & General.xlWst.Range(aa).Row 'Concat the D Column number with the cell number
dd = "J" & General.xlWst.Range(aa).Row 'Concat the J Column number with the cell number
ee = "K" & General.xlWst.Range(aa).Row 'Concat the K Column number with the cell number
ff = "I" & General.xlWst.Range(aa).Row 'Concat the I column number with the cell number
gg = "H" & General.xlWst.Range(aa).Row 'Concat the H column number with the cell number
'
'---- Check to see if a R&D bonus exists and update the workbook ---------'
For a& = 1 To x& + 1 'How many times to run the loop
b& = h.Offset(1, 0).Value 'Find the project amount
'
If General.xlWst.Range(ff).Offset(1, 0).Value > 0 Or General.xlWst.Range(gg).Offset(1, 0).Value > 0 Then 'Look to see if there is a R&D bonus
d& = General.xlWst.Range(ff).Offset(1, 0).Value + General.xlWst.Range(gg).Offset(1, 0).Value 'Get the extra bonus number
e& = (b& * d&) / 100 'Convert this to the percentage number
b& = b& + e& 'Add the extra bonus into the RP number
General.xlWst.Range(cc).Offset(1, 0).Value = b& 'Copy the new updated RP number to the workbook
End If '
'
General.xlWst.Range(dd).Offset(1, 0).Value = RD 'Call the RD function to get the die roll
General.xlWst.Range(ee).Offset(1, 0).Value = ResearchResults$ 'Add the results text to
General.xlWst.Range(bb).Offset(1, 0).ClearContents 'Move the curser 1 cell to the left and clear the contents
Next a& 'Wash and Repeat
After User Selects A WS From A Listbox, How Do I Go To That WS.
I have a userform with a listbox that lists all the Worksheets in the active WB, when the user clicks on OK I need to go to that selected Worksheet, in cell A1, and then I can paste my data. Any Ideas -Herrtodd
Code:
Sub selectsheet()
On Error Resume Next
UserForm1.Show
End Sub
Private Sub UserForm_Initialize()
Dim ws As Worksheet
With Me
For Each ws In ActiveWorkbook.Worksheets
UserForm1.ListBox1.AddItem ws.Name
Next
End With
End Sub
Private Sub OK_Button_Click()
bResponse = True
UserForm1.Hide
End Sub
Private Sub CommandButton2_Click()
bResponse = False
Unload UserForm1
End Sub
DLL Renamed Still Selects Newer!!
I have created a dll compiled it and it works fine. 'MESSERDLL'
Now i have made a update and a lot of the functions are different to enable them both to run on the same computer I renamed the project to 'MESSER_DLL04'
but when I compiled the new 1 even though it is a completly different file and project name and folder and comes up as a different name in references the old project still automaticly select the new dll and brake.
How do I get 2 dll's different versions (names don't mater) tobe completly seperate and not interfere with each other?
MergeCells Vs Selects The Whole Cells
Hi
My Q is
Why i can't use the mergecells with select whole cells
Wht's wrong with this code
Code:
Option Explicit
Dim b As Integer
Private Sub Form_Load()
With MSFlexGrid1
.Cols = 4
.Rows = 3
.TextMatrix(0, 0) = "Row 1"
.TextMatrix(0, 1) = "same"
.TextMatrix(0, 2) = "same"
.TextMatrix(0, 3) = "same"
.MergeCells = flexMergeRestrictRows
.MergeRow(0) = True
End With
End Sub
Private Sub Command1_Click()
On Error Resume Next
'Selects the whole Grid
With MSFlexGrid1
If b = 1 Then
.RowSel = .Row
.ColSel = .Col
b = 0
Else
b = 1
.Visible = False
.Row = 1
.Col = 0
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.TopRow = 1
.Visible = True
End If
End With
End Sub
MSFlexGrid - Selects Last Row Even When No Row Selected
I've no doubt this issue was addressed somewhere at some time, but I can't find it.
I give the user the option of deleting a row via a PopupMenu (left click row, menu pops up).
It works great on all the rows I use it on.
However, if I click below the last row (still within the grid), the .Col property thinks the user clicked the last row and my popup Menu allows deletion of that row.
I don't want the PopupMenu to show if the user clicks the grid anywhere but on a valid row.
Suggestions?
Combo Box Selects First Record Only
When i run this code below - then click my Combo Box it displays all the records in my database as expected.
BUT when i click on any record further down in the drop down list it always populates my text boxes with the first record in my database.
It never changes the text when i click on a different record from the list?...whats going on?
Do i need to add something else to this code below to get it to change when the user selects a different item from the list?
VB Code:
Private Sub Combo_senders_code_Click()Dim Conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim sql As StringDim FileName As String '========================FileName = "k:
ew.MDB"Set Conn = New ADODB.ConnectionConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source =" & FileName Set rs = New ADODB.Recordsetrs.Open "SENDADDRESS", Conn, adOpenKeyset, adLockOptimistic, adCmdTable '========================= sql = "SELECT * FROM SENDADDRESS WHERE shortcode = '" & combo_senders_code.Text & "'" 'rs.Open sql, Conn combo_senders_code.Text = rs![shortcode] senders_contact.Text = rs![Name] senders_phone.Text = rs![phone] senders_co.Text = rs![company] senders_addr1.Text = rs![address1] senders_addr2.Text = rs![address2] senders_city.Text = rs![city] senders_state.Text = rs![state] senders_cntry.Text = rs![country] senders_zip.Text = rs![postcode] senders_account.Text = rs![senderaccount] senders_email.Text = rs![email] senders_sign.Text = rs![signature] rs.Close End Sub
User Selects A Directory
I would like to use the CommonDialog control to let the user selects the directory and put the location of the directory in a textbox, is that possible with a commondialog?
User Selects Picture From File
Hi, need help!
I am writing a program, and I need the user to be able to select a picture from a file on the hard drive. (File is any picture file saved on the computer). This file must then be loaded onto a box on the screen.
I'm not sure how to go about doing this
Adding Text Where User Selects
Hi, I would like a user to be able to click a spot in a normal textbox, and have text appear in the place that they clicked. This WILL Have to be in between things so, say that they have a set of parentheses, and they click in between them, text should appear in between those parentheses.
-Viperchief
User Selects Files To Process
I have searched on your forum and I have found alot of questions that are extremely close to what I need, but not quite all the way there. I need users to select files in multiple locations over multiple drives on the server and output their selections with full paths to a text file or some sort of display for review and further manipulation (zipping). I am having trouble with two initial things. I have a open files box popping up exactly how I want it except for the fact that it only allows selection of one file. What I want is uers to be able to select files until they are finished, then click the 'done' button and all the files with full paths are processed at that point. I am hoping someone can help or point me to the right spot!!! the only code I have so far is mentalis.org open file dialog and I have been manipulating it. Thanks in advance to anyone who takes this problem on.
Two Selects One Userinput,, A Compare And One Output...
Im having some problems, or a challange as we like to say in these days, with some select statemenst..
First I want to select a number of values in one field based on a compare from a user input box.
lets say:
select field1 from table1 where field2 = user input
lets say that the table has tree records where field1 has the values 1,2,3 and field2 (no dublicates) has the the values a, a, and c.
If I enter a in the input box I want to have the number 1 and 2 returned.
then in another select I whish to return the values for all fieldA in table matching the value from the above select
field1 exist in both tables.
lets say that only one of the two values are found in table2.fieldA then I want to my DoCmd.OpenReport........, (the where clause) where it prints out matching table2.fieldA no matter if one or multiple matches are found...
but I cannot see that my user input get validated correct as a string, and i seems that the value I assign in my SQL is the statement rather than the actual value...
I hope you can help me out,,,that and undestand what I just wrote... because I think it is a bit tricky
User Selects Database Name && Table Name
Just toying with a few ideas at the moment and there is one paticular problem I would like advice on:
The vb app I want to create will need to allow the user to connect to an access database at run time but unknown to me is the path, database name and table name of the database the user wishes to connect to. Thankfully regardless of this, the fields in all tables will be the same.
I'm thinking about using the commonDialog but if I were to do this how would the user be able to select the desired table from said database?
If anyone can give me advice on this please. Perhaps there is a better way to achieve this??
F10 Selects First Menu Item (File)....
How can I disable the F10 button from selecting the first menu item. For example, I have a menu that has: File, Edit, ....., etc. Everytime I press F10 it presses down the first item in the list (in this case F10). It doesn't force the File menu to be displayed, it just depresses the File button. I removed the File button and it then would do it to the Edit button. I am wanting to use the F10 button for something else but I can't get rid of this nasty side effect. Any ideas?
Thanks
How Do You Find Out Which File A User Selects?
How do you know which file a user has selected from a filelist box? I thought it was file1.list(listindex) or file1.list(filename), but they just seem to report the first item in the list.
Updating Textbox When User Selects From Datacombo
I have a table in my access database with two colums (A & B). I also have a form with a datacombo and a textbox .
The datafield for the datacombo is colum A and the datafield for the textbox is colum B.
When a user selects data in the datacombo I want the textbox to be updated with the corresponding value.
For example: datacombo contains a list of items...i want the textboxto display the price of the currently selected item.
I appreciate any help that is offered. Thanks in advance!!
Reading All File Names In A Directory That A User Selects
Hi!
I was wondering how a person would go about retrieving file names from a directory that a user selects. I'm able to select multiple names once their in the directory, however I just want them to select a folder... ie: c:windows - then it would loop through an array and retrieve any file names in there...
Thanks - Zack
Request A Password When User Selects From Combo List
I have a combobox on one of my forms which is conneted to a database. When you drop down the list it gives me employee names. What i want to achive is that when a employee selects his name from the list he must be prompted for a password, can this be done?
Which Event Fires When User Selects Text In Combo
I want to erase the entire text in a combobox if user selects all text(in the upper "textbox") by dragging mouse over it. So I need an event where I can place this code. Which one can I use?
Thanks
jen
Selects Items From List Box To List Box?
Hi everyone!
Has anyone seen a good example of how to set up a list box and then have an arrow button pointing to another list box which allows the user to select the items they want...... geesh this is hard to explain, and I dont know what to call it....
Basically the first box contains all of the possible selection avliable to the user and the highlight each one they want and hit the 'arrow' pulling those selected items into the 'selected' box. Make sense?? Most that I've seen professionally done include arrows to 'de-select' and another set to 'select all' and 'deselect- all'
Any pointers or examples on how to do this would be greatly appreciated. I currently have a well functioning program using just a single selection at a time and would like to upgrade it to have this type of functionality.
Thanks!
Willie
Importing Multiple Sheets From A Excel Spreadsheet Into Multiple Tables
hello all,
I am trying to code, but i am just stuck after importing one sheet. so here is the gist of what i need help with.
In a workbook at the start of the year (january) i will have 4 sheets and these sheets will keep increasing to 12 when the month is december. so i want is, sheet 1 (named abc) should go into table 1 (named abc), sheet 2 (named def)should go into table 2 (named def), sheet 3 (named xyz) should go into table 3 (named xyz). then sheet 4 through the next sheets till sheet 12 (named balance1, balance2, abalance3...so on till balance12) should all go into one table 'table4' (named balance) and all these sheets should keep appending starting from 1 then 2 all the way to 12.
I am able to put one sheet into one table and below is the code....i need help with the other part of my requirement
Code: ( text )
Dim cn As ADODB.Connection
Dim oRs As New ADODB.Recordset
Dim cnAccess As ADODB.Connection
Dim rsAccess As New ADODB.Recordset
' Open Excel Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:Test.xls;" & _
"Extended Properties=Excel 8.0;"
.Open
End With
' Open Access Connection
Set cnAccess = New ADODB.Connection
With cnAccess
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:Documents and SettingskrishnamDesktopIntercompany Consolidation.mdb;"
.Open
End With
' Load ADO Recordset with Excel Sheet1Data
oRs.Open "Select * from [abc$]", cn, adOpenStatic
MsgBox oRs.RecordCount
' Load ADO Recordset with Access Data
rsAccess.Open "select * from tbl_abc", cnAccess, adOpenStatic, adLockOptimistic
MsgBox rsAccess.RecordCount
'Synchronize Recordsets and Batch Update
Do While Not (oRs.EOF)
rsAccess.AddNew
For i = 0 To 11 -----11 columns in table 1
rsAccess.Fields(i).Value = oRs.Fields(i).Value
Next
rsAccess.Update
oRs.MoveNext
Loop
End Sub
please help me so that i can move forward...
Updating Multiple Records Using Single Field Multiple Values..
dear
i have a flex in whcih i am displaying records.
lets say there are 5 records in the flex, with srno 1, 2, 3, 4, 5 and out of these 5 records i want to update 3 records srno 1, 3, 5.
srno date
1 01/12/2005
2 02/12/2005
3 10/12/2005
4 10/12/2005
5 11/12/2005
Like in delete statement we use this syntax.
delete * from tablename where fieldname in ("fieldvalue")
can we use the same concept for updating single field date in my case
can we use update like given below
update tablename set date = " & "'" & Format(Date, "dd-MM-yyyy") & "'" & " where srno in ("1,3,5")
But even after using the above syntax my data is not updated and also im not getting any error msg
hope to get helpful replies
regards
ladoo
Passing Multiple Parameters To A Multiple Value Parameter Field In Crystal
Hello,
I am using CR Developer 8.5 and Access 2000.
I have a multiple value parameter in an agent report that is a string. This parameter is used for capturing agent IDs. Parameter values are entered through an Access 2000 form. I need to allow users to enter multiple agent IDs into a text box on the form and then pass those values to the multiple value parameter in the report.
For example, the user would enter the following into the text box:
MA0083, MF0265, MH5698, etc
The report would then return information related to those 3 agents.
I am using .ParameterFields(0) in code to populate the parameter in the report using the following code:
rpt.ParameterFields(0) = "Agent;" & P18Agent & ";TRUE"
This works fine for sending only 1 agent ID to the report but how can I send multiple values from the text box P18Agent to the multiple value parameter in the report?
Thanks for your help.
Recalling Data From Multiple Fields In Multiple Tables
I am working on a fairly large project for recording client information into a db which has quite a few fields which are spread out among several tables. The code is already written that saves the data to it's appropriate fields in their appropriate tables.In this particular case, under the front tab of the form is the head person's personal information. On the third tab is information pertaining to the head person's dependents. The code I have written saves the head person's data as well as the data pertaining to that person'd dependents' to a table named [Person]. A few lines lower, those persons' IDs are also entered into an additional table called [Relation], in which are only 2 fields: Relation_Parent_ID and Relation _Child_ID. In another control's code, I recall the data of a given person's ID back into the form from which it was recorded. But how do I code it so that even the children's data is recalled when the parent's data is re-inserted into the form? The code to recall every piece of data that is saved for that person's ID, except for the children's data, is already written and functional. How can I cause the children's data, also, to be recalled when the parent's data is recalled?
Thank you very much for all your help
Happieman
a.k.a. Bill
Edited by - Happieman on 6/11/2005 10:18:40 AM
Deleting Multiple Files In Multiple Dirs When Paths Are In A Db
Greetings,
I am writing an application that will allow the user to delete files in a directory. The user can set the file path, file type, and deletion age (the age the file must be older than to delete.)
The program is supposed to allow a user to input wildcards as the file type - so , a user might enter that they want all files in c: 00 deleted if the file is older than 5 days. The problem is that I am not sure how to write the code to get a count of the files in the directory, and then delete them.
Any ideas? The deletion does work, if I modify this line to point to an actual file
Code:
'Set the file path and type
Set CurFile = fso.GetFile(rs!FilePath & rs!FileType)
but I am not sure how to go about writing the loop that must be required to delete every file in every directory in the db. I am attaching the total project and mdb as well. I am almost certain that my problem is related to looping (or a lack thereof) rather than a database problem. Project is using DAO and an Access db. I sincerely appreciate any help.
Code:
Private Sub cmdRunCleaner_Click()
'###############################################################
'# #
'# This sub Deletes the files. #
'# #
'###############################################################
Dim CurFile As File
Dim fso As New FileSystemObject
Dim CurrentDate As Date
Dim Temp As Integer
'Get the RS and sort it
Set rs = db.OpenRecordset("Select JobNum,ProjectName,FilePath,FileType,DeletionAge From tblFileInfo Order By ProjectName")
rs.Sort = "ProjectName ASC"
'If there are no records, handle the error.
If rs.EOF = True And rs.BOF = True Then
MsgBox "There are no cleaner jobs in the database.", vbOKOnly, "Jobs not found"
Exit Sub
Else
'While there are still records....
Do While Not rs.EOF
MousePointer = vbHourglass
'Set the file path and type
Set CurFile = fso.GetFile(rs!FilePath & rs!FileType)
'Get the current date and time
CurrentDate = Now
'Find the number of days difference between the file modified date and today
Temp = DateDiff("d", CurFile.DateLastModified, CurrentDate)
'If the file age is older than the deletion age, delete the file
If Temp > rs!DeletionAge Then
'Add file and size to counts
FileCounter = FileCounter + 1
FileSize = FileSize + CurFile.Size
'Delete the file
CurFile.Delete
Else
'Do Nothing
End If
'Move to the next record
rs.MoveNext
Loop
End If
rs.Close
'display the file stats for this run
lblcurFiles.Caption = FileCounter
lblcurspace.Caption = Format$((FileSize / 1024 / 1024), "Standard") & " Mb"
'add up, display, then save the current totals to the overall totals
Set rs = db.OpenRecordset("Select * From tblFileStats")
'add the current totals to the cumulative totals and display
lblTotalfiles.Caption = rs!totalfilecount + FileCounter
lbltotalspace.Caption = Format$(((rs!totalfilesize + FileSize) / 1024 / 1024)) & " Mb"
'update the totals and date in the DB
With rs
.Edit
rs!totalfilecount = rs!totalfilecount + FileCounter
rs!totalfilesize = rs!totalfilesize + FileSize
rs!LastDate = CurrentDate
.Update
End With
MousePointer = vbDefault
End Sub
Multiple Image Controls With Multiple Collisions At The Same Time
can anyone show me how to create multiple collisions function for image controls? i want every image collide with one another at the same time, i've tried using for-loops but the collision happens pair by pair it means that only two images can collide at one time ... please help meeee
Multiple Forms And Multiple Winsocks Question...
I'm trying to write a client that uses multiple forms. In effect, it is a hybrid client/server that allows for interapplication communication without the use of a central server.
However, I'm having trouble getting to grips with how I should approach this, and what sort of design pattern one could use, or if there's any examples.
This is what I want to do:
1) Have a server socket that listens.
2) Have a command parsing socket that receives a connection from the server socket
3) Depending on the command analysis of the parsing socket this socket should open one of three different kinds of forms.
4) The parsing socket should establish itself as the data transfer socket for the opened form.
This is a .Net aircode snippet that I've written to sort of understand the problem, but I'm writing this app in VB 6 because I must use Winsock and because the one I'm writing it form doesn't want to install the .Net framework.
Code:
Public Sub Listener_ConnectionRequest()
If Listener.State = SocketStates.sckCOnnected then
dim temp as integer = socketArray(socketArray.GetUpperBound(0)+1)
ReDim socketArray(temp)
Socket(temp).Accept(requestID)
End If
End Sub
Public Sub Socket_DataArrival()
Dim strDat as String
If Socket.State = SocketStates.SckConnected then
Socket.Getdata(strDat,vbString)
ParseData(strDat)
End If
End Sub
Private Sub ParseData(strDat as Sting)
Dim cmd as String
cmd = Microsoft.Visualbasic.Left(strDat,4)
Select case cmd
Case "chat"
chat = new frmChat
chat.Socket = Socket
chat.Show()
Case "file"
fil = new frmFiles
fil.Socket = Socket
fil.Show()
Case mesg"
End Select
End Sub
VB6 just won't let me assign the socket as I do in the above code. And of course, it reports an error already in the IDE when I try to Set it.
Anyone with any ideas?
I'd appreciate it.
Cheers,
Microman
Autofilter With Multiple Columns And Multiple Criteria
Hi
I have a sheet of data, which I need to clear up. What I want to do is use the autofilter function to filter out the information that I need, leaving what I don't need visible and then delete the visible rows.
First filter is on column D, where I need to select all rows that are in "Unit1" and then filter on column C to select all rows that are NOT "Team1" or "Team2".
Code I have is:
vb/
Dim CheckRange As Range, DeleteRange As Range
Set CheckRange = Worksheets("Sheet1").Columns(7)
CheckRange.AutoFilter Field:=4, Criteria1:="Unit1"
CheckRange.AutoFilter Field:=3, Criteria1:="<>Team1", Operator:=xlOr, Criteria2:="<>Team2"
Set DeleteRange = CheckRange.SpecialCells(xlCellTypeVisible).EntireRow
DeleteRange.Delete
/vb
However this does not work. It filters out all the non "Unit1" rows fine, but then applied a filter to Column C that does nothing!
Can someone help put me out of my misery?
Countif() With Multiple Criteria && Multiple Sheets
Hi!
I have 4 sheets in an excel workbook
The data starting from the sheet1 column B row 3 (B3) (the column A is empty only in the sheet1 not to the others three) and i dont know where the columns ending.
What i know is that the columns never be more than 1024 (256 columns x 4 sheets)
The data that there are in the cells, are numbers from 0 to 5.
The row 2 (B2, C2,..., IV2 etc) is using to make a group, so there are text numbers (01,02,03 etc ) for the purpose. So i will have 10 columns with 01, 50 columns with '02', 45 columns with '03' on the row2 and goes on.
But
What i want is:
I want to count how many 0,1,2,3,4 and 5 are for each cell grouping by the row group each time i choose.
So i want to count the the 0,1,2,3,4 and 5 for the group '01' or
count the the 0,1,2,3,4 and 5 for the group '03'.
Example
In a single sheet if i want to find the 0 and if i know where the columns of the group '01' starts and ends it would be like this
COUNTIF(INDEX('sheet1'!3:3,1,B2):INDEX('sheet1'!3:3,1,I2),0))
I hope you understand
Thanks in advance
Stathis
Countif() With Multiple Criteria And Multiple Sheets
Hi!
I have 4 sheets in an excel workbook
The data starting from the sheet1 column B row 3 (B3) (the column A is empty only in the sheet1 not to the others three) and i dont know where the columns ending.
What i know is that the columns never be more than 1024 (256 columns x 4 sheets)
The data that there are in the cells, are numbers from 0 to 5.
The row 2 (B2, C2,..., IV2 etc) is using to make a group, so there are text numbers (01,02,03 etc ) for the purpose. So i will have 10 columns with 01, 50 columns with '02', 45 columns with '03' on the row2 and goes on.
But
What i want is:
I want to count how many 0,1,2,3,4 and 5 are for each cell grouping by the row group each time i choose.
So i want to count the the 0,1,2,3,4 and 5 for the group '01' or
count the the 0,1,2,3,4 and 5 for the group '03'.
Example
In a single sheet if i want to find the 0 and if i know where the columns of the group '01' starts and ends it would be like this
COUNTIF(INDEX('sheet1'!3:3,1,B2):INDEX('sheet1'!3:3,1,I2),0))
I hope you understand
Thanks in advance
Stathis
How Do YOU Work With Multiple Programmer And Multiple Project ?
Hi all
I think many of you are working for software companies and I want to have an idea of your projects handling.
I want to know how do you work on many projects with many programmers ?
Do you have code bank or common module ?
How do you handle you code bank or modules ?
what software do you use to do your management ?
etc.. ?
Thanks for all your response
(I don't know if this post should be here .. so move it please if it belongs somewhere else)
Prevent Multiple Select In Multiple Combos
Hi,
I have a control array of 13 combo boxes cmb6Pos(0) to cmb6Pos(12) that are all loaded with the same list of alphanumeric codes. How can I prevent a code from being selected in a combo box if it has already been selected in another?
Any pointers or code would be great, thanks,
Mat
Multiple .MDF Files With 1 Table OR 1 With Multiple Tables?
In the past, I justed just one .MDB (access) database file with multiple tables, but have run across several commercial programs that have multiple .mdb files with one table. Those tables are then all linked.
Is there reason to go one way or the other and why? If using multiple .mdb files, how do you create the links between the tables in different .mdb files?
--Gary
Searching Multiple Fields With Multiple Lists
hi all:
i have a lot of combo boxes full of values and each combobox represents a field on a table, i wish to get all the rows that correspond with any value from the combo box for the field.
for example
combo1 has 5 values and the field that corresponds with combo 1 is field 1
combo2 has 6 values.....
and each combo can have any number of values
i want to know all the rows that their values match each field based on the combo values
i thougth of this...
select * from table where field1 in (all of combo1 values)
the real problem is how to get all the combo 1 values in the parethensis becausse all combos have different number of values thanks
Multiple Recordsets && Multiple Grids - Urgent Help Please!?
Looking at the attachment,
I need suggestions.
What I am trying to do is, I have ADODC control for every Grid in every tab (see attachment image for every tab sample).
Every ADODC control has records for each Grid.
Records are coming from multiple tables.
Whenever, separate Grid values be added, updated or deleted, surely first every ADODC control be updated and thanafter Grid will be refereshed to show changed values.
I am using SQL queries for updating ADODC controls.
But Grids are not properly updating, When I use UPDATE or DELETE queries.
Any Comments and suggestions about my pattern of using Multiple Recordsets and Grids for every tab... !?
SelectionFormula - Multiple Range And Multiple Type
dim m, a, b, name, datein, dateend
name = text3.text
datein = text1.text
dateend = text2.text
m = text4.text
'ERROR 1:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND {Table1.date} IN Date(" & a &") To Date(" & b &")"
'ERROR 2:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND month({Table1.date} in [" & m &"," & m & "])"
I allow the user to key in the "date range"/"month" + name in vb, then pass the selectionformula to the crystal report designed.
For example1: name = KEN, a = 2003, 12, 31 , b = 2003, 01, 31
then the report will print out the customer name equal to KEN and transaction during the period.
For example2: name = Steven, m = 2
then the report will print out the customer name equal to Steven and transaction during February.
Anyone can help?
Multiple Row Tooltiptext And Multiple Row Text In Excel
alo guys i really need help here...
i use VB to link with excel to produce a shape objects.
but i got difficulty to put a multiple row text.
shape1.TextFrame.Characters.Text = SCN & vbCrLf & rsGet!ves_name
the vbcrlf is printed to a character in the textframe.
how to get rid the character off, but i can use the multiple rows....
and how to use the multiple row tooltiptext...
VB only provide one row tooltiptext only....
thanks to all of you ...
aliank
Updating Multiple Tables With Multiple Recordsets
Hi,
I am trying to update two tables at once, based on the same text box inputs I seem to come close but it will not update the second table. Here is my code:
Option Explicit
Dim Rs As Recordset
Dim Rs2 As Recordset
Dim CN, CN2 As Connection
Private Sub cmdBack_Click()
If Not Rs.BOF Then
Rs.MovePrevious
End If
If Rs.BOF And Rs.RecordCount > 0 Then
Rs.MoveFirst
End If
End Sub
Private Sub cmdNext_Click()
If Not Rs.EOF Then
Rs.MoveNext
End If
End Sub
Private Sub cmdRefresh_Click()
Rs.Requery
End Sub
Private Sub cmdSearch_Click()
Rs.MoveFirst
Rs.Find "LastName = '" & txtSearch & "'"
If Rs.BOF Or Rs.EOF Then
If MsgBox("The record you entered was not found, Do you want enter another name ?", vbQuestion + vbYesNo, "ID Check") = vbYes Then
txtSearch = ""
txtSearch.SetFocus
Exit Sub
Else
Rs.MoveFirst
txtSearch = ""
Exit Sub
End If
Else
'Fills in the data with the fields based on the found data
txtLastName = Rs.Fields("LastName")
txtAmount1 = Rs.Fields("Amount1")
txtAmount2 = Rs.Fields("Amount2")
End If
End Sub
Private Sub Command1_Click()
Dim ST As String
Rs.AddNew ' Add a new record
Rs.Fields("LastName") = txtLastName
Rs.Fields("Amount1") = txtAmount1
Rs.Fields("Amount2") = txtAmount2
Rs.Update
'CurrentDB.Execute ("Update tblName2 Set Last_Name = '" & txtLastName & "',Amounta = '" & txtAmount1 & "',Amountb = '" & txtAmount2 & "'")
Rs2.AddNew ' Add a new record
Rs2.Fields("Last_Name") = txtLastName
Rs2.Fields("Amounta") = txtAmount1
Rs2.Fields("Amountb") = txtAmount2
Rs2.Update
End Sub
Private Sub Form_Load()
Set CN = New ADODB.Connection
CN.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = H:E544293Desktopdb1.mdb;"
Set Rs = New Recordset
Rs.Open "Select LastName, Amount1, Amount2 from tblLastNames", _
CN, adOpenKeyset, adLockOptimistic
Set CN2 = New ADODB.Connection
CN2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = H:E544293Desktopdb1.mdb;"
Set Rs2 = New Recordset
Rs2.Open "Select Last_Name, Amounta, Amountb from tblName2", _
CN2, adOpenKeyset, adLockOptimistic
Set txtLastName.DataSource = Rs
Set txtAmount1.DataSource = Rs
Set txtAmount2.DataSource = Rs
txtLastName.DataField = "LastName"
txtAmount1.DataField = "Amount1"
txtAmount2.DataField = "Amount2"
End Sub
I think it has to do with the adOpenKeyset, adLockOptimistic at the end of the connection string, but if it is this it will not let me take it out or chage it. I also tryed moving things around and that did not woprk.
If any one has any ideas, of waht I am doing wrong, I would really appreciate it
Thank You
How To Send Multiple To Multiple Data Using Winsock
I have two forms client and server i run in a localhost. I want to send multiple data from client and server. but how?
My program is too big and long so I make a simple same example to you
Lets say I got String a,b,c i want to send a,b,c to the server and stored in String sa, sb,sc in the server form then send ack(acknowladgement) back to the client...ask client to send the different new data back to the server again but....the data in the server get corrupted in second time ...means it only accept b and c...it ignore the a why?
please help thanks
Code:dim a,b,c,ack as string ' in global
privete sub command_send click
a="qwe"
b="qwe"
c="qwe"
tcpclient.senddata(a)
tcpclient.senddata(b)
tcpclient.senddata(c)
end sub
dim sa,sb,sc.ack as string 'in global also
Private Sub tcpserver_DataArrival(ByVal bytesTotal As Long)
call tcpclient.getdata(sa,8,3)
call tcpclient.getdata(sb,8,3)
call tcpclient.getdata(sc,8,3)
text1.text= a & b & c
ack="received"
tcpclient.senddata(ack)
end sub
Private Sub tcpclient_DataArrival(ByVal bytesTotal As Long)
call tcpclient.getdata(ack)
a="xcx"
b="xcx"
c="xcx"
tcpclient.senddata(a)
tcpclient.senddata(b)
tcpclient.senddata(c)
end sub
Multiple DLLs For Multiple Processors?
I was surprised to learn a while back that even if you have lots of copies of a program running there is only ONE copy running of whatever DLL that program may call. This makes sense on reflection as the processor is really only running one program at a time but switches between them in some kind of clever sequence and so having lots of copies of the DLL would be pointless.
My question: In the case of a dual processor would two copies of the DLL be loaded?
Multiple Timers And Multiple Forms
Hi, all,
Please help me with this issue.
I have three forms f1, f2, f3. On each form there is one timer, t1, t2, t3, respectively. All forms have been loaded. When f1 is shown and f2, f3 are hidden, are t2 on f2 and t3 on f3 still working? Assume t2 and t3 are not disabled explicitly within code.
Thanks a lot!
xihu24
|