|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#31
|
||||
|
||||
|
uggghhhh stupid containers.....
I'm doing this blind, but mess around with the quotes and apostrophes..... I am at work and don't have time atm, but I will look into it tonight when I have a 6-pack and some shots handy ![]()
__________________
Did I help you? If so gimme rep by clicking on the at the top right corner of this post ![]() Madness does not always howl. Sometimes, it is the quiet voice at the end of the day saying, "Hey, is there room in your head for one more?" Last edited by sbenj69 : May 8th, 2008 at 04:29 PM. |
|
#32
|
|||
|
|||
|
Thats it....I had to add another " to your last entry...it works now...
phheeewwwwwww That was it...Fantastic....THANK YOU AGAIN VERY MUCH.... Code:
Private Sub Command110_Click()
Dim varField As String
varField = Selector1.Column(1)
Dim varAttribute1 As String
varAttribute1 = ""
If Not cbo1 = "" Then
varAttribute1 = cbo1
ElseIf Not cbo2 = "" Then
varAttribute1 = cbo2
ElseIf Not cbo3 = "" Then
varAttribute1 = cbo3
ElseIf Not cbo4 = "" Then
varAttribute1 = cbo4
Else
End If
'MsgBox varAttribute1
Dim varAttribute As String
varAttribute = varAttribute1
'' STRING
Dim varCount As String
varCount = DCount(varField, "dbo_Core2", varField & " = '" & varAttribute & "'")
MsgBox varCount & " " & varAttribute
cbo1 = ""
cbo2 = ""
cbo3 = ""
cbo4 = ""
varAttribute1 = ""
End Sub
|
|
#33
|
|||
|
|||
|
have a couple on me....
|
|
#34
|
||||
|
||||
|
oh, don't worry, I will..........the other 4 I will save for AOG's problem
![]() |
|
#35
|
|||
|
|||
|
' create sql query
stSQL = "SELECT DISTINCT '" & varField & "' FROM dbo_Core2 " ' add criteria if necessary stSQL = stSQL & "WHERE '" & varField & "' = '" & varAttribute & "'" let's say that varfield is CUSTOMERID and varAttribute is a text value of "123" your string will look like this SELECT DISTINCT 'CUSTOMERID' FROM Dbo_Core2 WHERE 'CUSTOMERID' = '123' and I think it should be SELECT DISTINCT CUSTOMERID FROM Dbo_Core2 WHERE (CUSTOMERID = '123') I don't think you need the ' marks around your field name so it would be stSQL = "SELECT DISTINCT " & varfield & " FROM dbo_Core2 " stSQL = stSQL & "WHERE (" & varfield & " = '" & varattribute & "')" I didn't make an example of my own but it's worth a shot. You may also need to remove the ' marks from varAttribute if that value is numeric instead of text. EDIT --- OOP that will teach me to go afk for a while
__________________
---------------- If we've helped you and you have solved your problem please post that it's been resolved so we know! The suspense kills me! |
|
#36
|
||||
|
||||
|
lol, don't worry, I was missing a very big part of the equation for like 5 or 6 posts.... the fact that varfield is not the actual name of the field but rather the holder. Poor JK, had to read thru my useless posts until I realized that varfield changes names.
![]() |
|
#37
|
|||
|
|||
|
THANK YOU BOTH very much for your help...and your patience...
Nothing is wasted...all a great learning experience.. thank you again... Till my next issue.... ![]() |
|
#38
|
||||
|
||||
|
you're welcome, and I look forward to helping again in the future.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Selecting Records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|