ok so i was having a look at the faq section and i found faq703-3936 located at http://www.tek-tips.com/faqs.cfm?fid=3936
it says
I hate writing the same code over and over like the code that loops through the items selected in a multi-select list box. This function will accept a list box...
the text box ony has 1 item, a programaticly generated string (format as outlined above), it is generated from a multi select listbox
yes it is the record soruce of a report
so what am i doing wrong?
yep you are right
so it ended up looking something like this
Private Sub Combo5_LostFocus()
Dim ctl As Control
Dim varItem As Variant
Dim Str As String
Set ctl = Me.Combo5
Str = """"
For Each varItem In ctl.ItemsSelected
Str = Str & "'" & ctl.ItemData(varItem) & "', "
Next varItem
Str =...
yes thats what i meant
so if i want after the entire thing is over
myString to read
"'xx1', 'xx2', 'xx3'"
how would i do that
note, its not going to read xx1 in real life that will be a parameter for a query
i.e Select ... where [...] in myString or is null
basicly i have the string, i...
how does that work? wouldnt access just assume the
myString = """"
is my string = "should be text in here" "should be text in here"
as " is the operator for literal text is it not?
I need to programaticly construct the string: "'xx1', 'xx2', 'xx3'"
what is the code for putting a ' in a string? and a "?
unfortunately ive never done this and cant find it anywhere in the access help files, but thats not unusual.
and how do i programaticly construct "'xx1', 'xx2', 'xx3'"
what is the code for putting a ' in a string? and a "?
unfortunately ive never done this and cant find it anywhere in the access help files, but thats not unusual.
I have a list box on a form. the reason i have used a list box instead of a combo box is that id like to be able to do multiple selections from the one control.
Basicly fill in the fields on the form click the run report button and the report will open use the values from the fields (one of...
My hero
Thanks PHV
what was i doing wrong?
p.s for the record you cant group by when selecting * ;)
thats why i was having such trouble understanding my problem, how could no grouping be the error when its not possible to do so in this situation???
Ok so i think i have the sql sorted out now.
Private Sub Item_No_AfterUpdate()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strsql As String
strsql = "SELECT * FROM [Job Items]" _
& "HAVING [Project]= '" & [Forms]![NDrawing Entry]![Project] & "' AND [Partition]= '" & [Forms]![NDrawing...
but it didnt work at all with the original brackets, said it was missing all 7 parameters required to run the query.
This time it actually shows me the parameters in the error message and they are the correct parameters.
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.