473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

VB question

Stang02GT
1,208 Expert 1GB
Is it possible to code this in VB...

I want to have a button on a search form that once the user finds the record they are looking for has the option to i guess import that record into another table.


I was thinking of maybe a SQL insert statment done in VB....
Jul 20 '07 #1
42 2112
Rabbit
12,516 Expert Mod 8TB
Yes, you can do this with DoCmd.RunSQL "Insert Into ..."
Jul 20 '07 #2
Stang02GT
1,208 Expert 1GB
I'm having a really hard time with this SQL code and getting it to work...

i have a table that i need to pull in formation from (Tracker) and id like to copy a record from there into another table SRMisc.

The problem im running in to is that the column names are not the same in each table. In the Tracker table they are just a letter and number.... EX. z6, z7 ,z8, and in the SRMisc table they actually have names like Description, Comments. Another issue is that the Tracker table is a linked table with Ready only privlegages. So i did a create table query called traker ( just left out the C) so i could edit the data, and still cannot get it to work.

what i woud like to do...i would like to search for a record in traker from my form, then when the record is found, hit a button that is going to copy the record into my SRMisc table.

Can i do that since the data names do not match up? (I'm thinking no beucase it keeps giving me all different kinds of errors)
Jul 23 '07 #3
FishVal
2,653 Expert 2GB
Can i do that since the data names do not match up? (I'm thinking no beucase it keeps giving me all different kinds of errors)
Hi!

1. INSERT INTO statement needs the type of corresponding fields to match, no matter whether the names match or not.
2. Build a necessary append query in Query Builder, run it to check whether it works properly. Then copy/paste the SQL statement offered by Builder to your code making necessary corrections.

Good luck
Jul 23 '07 #4
Stang02GT
1,208 Expert 1GB
thanks for the rather rude reply

[Admin Edit: previous comment has been edited to removed offending statement]
Jul 23 '07 #5
JKing
1,206 Expert 1GB
Append queries are always easier when the names matchup however if they do not you can still do it.

Append Queries are in the following format:
Expand|Select|Wrap|Line Numbers
  1. INSERT into table2 (field1, field2, field3, ... fieldn)
  2. SELECT field1, field2, field3, ... fieldn
  3. FROM table1
  4.  
Now in your case the field names don't matchup but that's fine if the data is the same and you list the fields in the proper order. The order in which you list your columns in the INSERT line is the order the corresponding fields should be in the SELECT line.

Here's a little example... We have two tables. tblEmployee has full employee information and the fields empLastName and empFirstName and we've made a new table called tblEmpListing with the fields empLName and empFName.

The names aren't the same but the data is... the append query would look like this:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO tblEmpListing( empFName, empLName)
  2. SELECT empFirstName, empLastName
  3. FROM tblEmployee
  4.  
Here's what the wrong way would look like:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO tblEmpListing (empFName, empLName)
  2. SELECT empLastname, empFirstName
  3. FROM tblEmployee
  4.  
Doing it the wrong way we will end up with last names in the first name field and vice versa.

Hope this helps to clarify what you need to do.
Jul 23 '07 #6
Stang02GT
1,208 Expert 1GB
Ok i have made an append query and gotten the data into the table where it is supposed to go... here is my sql statement

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO SRMisc ( [Tracker Item], Description, Comments, Requestor, [SR Num] )
  2. SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6
  3. FROM Tracker
  4. WHERE (((Tracker.Z6)="3918"));

I selected a random record being 3918....how can i put this into VB code and have it append the current record selected on my form by using the Onclick event?

My goal is to have the user pull up a record and be able to hit a button to place the record in the correct table.
Jul 23 '07 #7
JKing
1,206 Expert 1GB
Something like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Append_Click()
  2.  
  3. Dim strSQL as String
  4.  
  5. strSQL = "INSERT INTO table1 (field1, field2) SELECT field1, field2 FROM table2 WHERE table2.ID = " & Me.ID & ";"
  6.  
  7. Docmd.RunSQL (strSQL)
  8. End Sub
  9.  
Me.ID would be the control that holds the ID for that record.
Jul 23 '07 #8
FishVal
2,653 Expert 2GB
Ok i have made an append query and gotten the data into the table where it is supposed to go... here is my sql statement

INSERT INTO SRMisc ( [Tracker Item], Description, Comments, Requestor, [SR Num] )
SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6
FROM Tracker
WHERE (((Tracker.Z6)="3918"));


I selected a random record being 3918....how can i put this into VB code and have it append the current record selected on my form by using the Onclick event?

My goal is to have the user pull up a record and be able to hit a button to place the record in the correct table.
Insert to OnClick event handler the following code:
Expand|Select|Wrap|Line Numbers
  1.     Dim strSQL As String
  2.  
  3.     strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  4.            "Comments, Requestor, [SR Num] ) " & _
  5.            "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  6.            "FROM Tracker WHERE Tracker.Z6='" & _
  7.            VariableContainingSearchCriteria & "';"
  8.     DoCmd.RunSQL strSQL
  9.  
Jul 23 '07 #9
Stang02GT
1,208 Expert 1GB
The code works with out generating any errors but it pastes 0 Records


in the VariableContainingSearchCriteria & "';"

Do i replace that with the text box where the search criteria is ... so it would me Me.Text19

or do i place the actual data im seraching for Me.Z6


sorry for my ignorance on this subject i am extremely new to VB coding
Jul 23 '07 #10
Stang02GT
1,208 Expert 1GB
I Got It To Work!!!!



Thank You Both So Much!!!
Jul 23 '07 #11
FishVal
2,653 Expert 2GB
The code works with out generating any errors but it pastes 0 Records


in the VariableContainingSearchCriteria & "';"

Do i replace that with the text box where the search criteria is ... so it would me Me.Text19

or do i place the actual data im seraching for Me.Z6


sorry for my ignorance on this subject i am extremely new to VB coding
Sure.
Replace VariableContainingSearchCriteria with Me.Text19
To avoid messages like "n records will be added" use DoCmd.SetWarnings property.

Expand|Select|Wrap|Line Numbers
  1.     Dim strSQL As String
  2.  
  3.     strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  4.            "Comments, Requestor, [SR Num] ) " & _
  5.            "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  6.            "FROM Tracker WHERE Tracker.Z6='" & _
  7.            Me.Text19 & "';"
  8.     With DoCmd
  9.            .SetWarnings=False
  10.            .RunSQL strSQL
  11.            .SetWarnings=True
  12.     End With
  13.  
Jul 23 '07 #12
Stang02GT
1,208 Expert 1GB
One last question...


can i have this look at another feild? like x5?

maybe an OR statement
Jul 23 '07 #13
JKing
1,206 Expert 1GB
Yes, you can. But you need to know whether you want an AND or and OR.

An AND will succeed where both conditions are true where as an OR will succeed if at least one condition is true.
Jul 23 '07 #14
FishVal
2,653 Expert 2GB
One last question...


can i have this look at another feild? like x5?

maybe an OR statement
Sure. Maybe OR or maybe AND, depends on what do you mean.
Smthng like
Expand|Select|Wrap|Line Numbers
  1. strSQL=".............. WHERE Tracker.x6='" & Me.X6 & "' OR Tracker.x5='" & Me.x5 & "';" 
Supposed both Tracker.x6 and Tracker.x5 are Text type fields.

The one important thing. If the type of table field is Text you should enclose criteria in single quotation marks ( ' ), if it is Date use #, and use nothing to enclose criteria if it is Number.

Example
WHERE Table.Field = 'text'
WHERE Table.Field = #01/01/01#
WHERE Table.Field = 123

Good luck.
Jul 23 '07 #15
Stang02GT
1,208 Expert 1GB
Yes thats what i was referring too, because some feilds have an X5 and not a Z6
(one is a tracking number and the other is a request number)

So id like it to try and get it to work if there is data in either feild apposed to just one





Thanks again!
Jul 23 '07 #16
NeoPa
32,556 Expert Mod 16PB
Strangely enough I posted this explanation in a thread earlier today. It's for that question (Need to create a selective(filtered) lookup report (thingy?) Edit Post) obviously, but I think the concept could be helpful here.
A problem many people struggle with when applying filter strings is "How to apply the AND and OR keywords?"
Seems obvious, but if I said we wanted to see records that were from January AND February, but no other months, would you use AND or OR in the Filter string?
If you said AND then you'd be wrong.
The Filter is checking each record as it is processed. Can any record be from both January AND February? No, it can't (You'd have no results at all). For each record, you want to determine if it is either January OR February (even though you want to include records from January AND February in your results set).
Jul 23 '07 #17
Stang02GT
1,208 Expert 1GB
I've got the code working to the point where if i remove the OR clause it works fine but when i add the OR clause i get this error


Run-time error '3464'

Data type mismatch in criteria expression
Jul 24 '07 #18
JKing
1,206 Expert 1GB
Post the SQL string with the OR statement in it that you are using. Is the field you are adding text? date? number? Text fields should be enclosed by ' and dates should be enclosed by #.
Jul 24 '07 #19
Stang02GT
1,208 Expert 1GB
X5 and Z6 are both number fields




Expand|Select|Wrap|Line Numbers
  1. Private Sub Command24_Click()
  2. Dim strSQL As String
  3.  
  4.     strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  5.            "Comments, Requestor, [SR Num] ) " & _
  6.            "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  7.            "FROM Tracker WHERE Tracker.Z6='" & Me.Z6 & "' OR Tracker.X5='" & Me.X5 & "';"
  8.     DoCmd.RunSQL strSQL
  9.     End Sub
Jul 24 '07 #20
NeoPa
32,556 Expert Mod 16PB
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use the tags in future.

MODERATOR.

PS. I have had to change your posts twice already in this thread alone (See post #7).
Jul 24 '07 #21
JKing
1,206 Expert 1GB
Try changing this line:

Expand|Select|Wrap|Line Numbers
  1. "FROM Tracker WHERE Tracker.Z6= " & Me.Z6 & " OR Tracker.X5=" & Me.X5 & ";"
  2.  
All I did was remove the single quotes in the statement. Since they are number fields they don't require the single quotes and it's probably assuming you're trying to pass text data into a number field causing your error.
Jul 24 '07 #22
Stang02GT
1,208 Expert 1GB
Try changing this line:

Expand|Select|Wrap|Line Numbers
  1. "FROM Tracker WHERE Tracker.Z6= " & Me.Z6 & " OR Tracker.X5=" & Me.X5 & ";"
  2.  
All I did was remove the single quotes in the statement. Since they are number fields they don't require the single quotes and it's probably assuming you're trying to pass text data into a number field causing your error.

Its still giving me the same error.
Jul 24 '07 #23
NeoPa
32,556 Expert Mod 16PB
Its still giving me the same error.
The format of your SQL was fundamentally correct (both before and after the change suggested). What we don't really know (unless I missed something somewhere) is the type of data stored in the two fields Z6 & X5. Actually it's the field type we need to be precise. There are three fundamental types handled by SQL :-
  1. String (Text)
  2. Numeric
  3. Date (/Time)
We need to know which type these fields are in order to formulate the WHERE clause correctly.
Jul 24 '07 #24
Stang02GT
1,208 Expert 1GB
The format of your SQL was fundamentally correct (both before and after the change suggested). What we don't really know (unless I missed something somewhere) is the type of data stored in the two fields Z6 & X5. Actually it's the field type we need to be precise. There are three fundamental types handled by SQL :-
  1. String (Text)
  2. Numeric
  3. Date (/Time)
We need to know which type these fields are in order to formulate the WHERE clause correctly.


They are both numeric


P.S. really sorry about the problems posting my code :(
Jul 24 '07 #25
NeoPa
32,556 Expert Mod 16PB
In that case JKing's recommendation is fundamentally correct.
You needn't worry about the CODE warning. You've been quite helpful around the place and that gives you plenty of leeway in my book.

We need to revisit posts #19 & #20 then.
To get the actual SQL string (as requested) add this line after your line #7 in post #20.
When you run the code you should find the actual SQL string used in the immediate pane of the VBA window.
I suspect you'll find one of the values not set, but let's wait for the SQL before jumping the gun.
Jul 24 '07 #26
NeoPa
32,556 Expert Mod 16PB
X5 and Z6 are both number fields (Post #20)
My turn to apologise :( You'd already answered my question.
Jul 24 '07 #27
Stang02GT
1,208 Expert 1GB
My turn to apologise :( You'd already answered my question.

lol its quite alright


Concerning the issue with my code, if i remove the OR clause the code works fine with no errors, but as soon as i place it back into my code it shots that error at me
Jul 24 '07 #28
JKing
1,206 Expert 1GB
Seems you did end up jumping the gun there NeoPa :P. I do my best to get all info I can before trying to solve the error. I am however going to have to agree that there is likely a null value being passed in. If you are allowing the user to only type into one textbox and leave the other blank(null) this will result in a null being evaluated in the where criteria.

Solution for this?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command24_Click()
  2. Dim strSQL As String
  3. Dim blnRunSQL As Boolean
  4.  
  5. blnRunSQL = false
  6.  
  7. strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  8.               "Comments, Requestor, [SR Num] ) " & _
  9.               "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  10.               "FROM Tracker " 
  11. If Not IsNull(Me.z6) AND IsNull(Me.x5) Then
  12.    strSQL = strSQL & "WHERE Tracker.Z6 = " & Me.Z6
  13.    blnRunSQL = true
  14. Elseif Not IsNull(Me.X5) And IsNull (Me.z6) Then
  15.    strSQL = strSQL & "WHERE Tracker.X5 = " & Me.X5
  16.    blnRunSQL = true
  17. Elseif Not IsNull(Me.X5) And Not IsNull(Me.Z6) Then
  18.    strSQL  = strSQL & "WHERE Tracker.Z6= " & Me.Z6 & " OR Tracker.X5= " & Me.X5 & ";"
  19.    blnRunSQL = true
  20. Elseif IsNull(Me.X5) And IsNull(Me.z6) Then
  21.    MsgBox "You must enter a value to search by."
  22. End If
  23.  
  24. If blnRunSQL Then
  25.     DoCmd.RunSQL strSQL
  26. End If
  27.     End Sub
  28.  
This will check to see which textbox they've typed into or check both. If both boxes are left blank prompt the user to enter something. The runSQL is only executed when something has been filled in.
Jul 24 '07 #29
NeoPa
32,556 Expert Mod 16PB
Stang, You need to visit post #26 and provide the information requested.
Jul 24 '07 #30
NeoPa
32,556 Expert Mod 16PB
Seems you did end up jumping the gun there NeoPa :P. I do my best to get all info I can before trying to solve the error.
I'm sorry JKing, I really don't get what you mean. I don't feel insulted or anything, it just doesn't make sense to me. I haven't posted my reply yet as I'm waiting for the info.
You have, on the other hand :confused:
Is it a form of irony you're using? Excuse me if I appear dim.
Jul 24 '07 #31
Stang02GT
1,208 Expert 1GB
I'm sorry JKing, I really don't get what you mean. I don't feel insulted or anything, it just doesn't make sense to me. I haven't posted my reply yet as I'm waiting for the info.
You have, on the other hand :confused:
Is it a form of irony you're using? Excuse me if I appear dim.

Neo,

I read the previous posts and i apologize but im not sure what you are asking for?
Jul 24 '07 #32
JKing
1,206 Expert 1GB
I'm sorry JKing, I really don't get what you mean. I don't feel insulted or anything, it just doesn't make sense to me. I haven't posted my reply yet as I'm waiting for the info.
You have, on the other hand :confused:
Is it a form of irony you're using? Excuse me if I appear dim.
Sorry, NeoPa I was just poking fun at the fact that you had asked about the data types when I had already done the same previously. So by jumping the gun I meant assuming one thing had not already been stated. We were both thinking along the same lines which is good. I didn't mean to confuse you nor insult. Just thought it was kind of funny, though my sense of humor may be a little off from lack of sleep. Now I see that I am the one who has jumped the gun and I think that's funny too.

Nevertheless! I do believe nulls are the issue here.
Jul 24 '07 #33
FishVal
2,653 Expert 2GB
Plz provide types of Tracker table fields. I mean open the table in design view and check types of table fields .
Despite you've posted in #20
X5 and Z6 are both number fields
at least Tracker.Z6 is text field according to SQL statement generated by Query Builder (post #7)
Ok i have made an append query and gotten the data into the table where it is supposed to go... here is my sql statement

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO SRMisc ( [Tracker Item], Description, Comments, Requestor, [SR Num] )
  2. SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6
  3. FROM Tracker
  4. WHERE (((Tracker.Z6)="3918"));
Jul 24 '07 #34
Stang02GT
1,208 Expert 1GB
Plz provide types of Tracker table fields. I mean open the table in design view and check types of table fields .
Despite you've posted in #20

at least Tracker.Z6 is text field according to SQL statement generated by Query Builder (post #7)


Then that is probably what is causing this error... if Z6 according to the SQL statement is a text feild then thats where i am getting hung up because both Z6 and X5 are Numeric Fields in the table.

If nulls are my problem, then like i said earlier that not every record has the Z6 data.....

what if i changed the order of the statment and switched X5 and Z6 in the statement so it looked like this

Expand|Select|Wrap|Line Numbers
  1.  "FROM Tracker WHERE Tracker.Z6=" & Me.Z6 & " OR Tracker.X5=" & Me.X5 & ";"
to this

Expand|Select|Wrap|Line Numbers
  1.  "FROM Tracker WHERE Tracker.X5=" & MeX5 & " OR Tracker.Z6=" & Me.Z6 & ";"
Jul 24 '07 #35
FishVal
2,653 Expert 2GB
Then that is probably what is causing this error... if Z6 according to the SQL statement is a text feild then thats where i am getting hung up because both Z6 and X5 are Numeric Fields in the table.
I suggest you to build append query with multiple criteria in Query Builder, make sure it is working properly and post SQL statement generated.
Jul 24 '07 #36
Stang02GT
1,208 Expert 1GB
I suggest you to build append query with multiple criteria in Query Builder, make sure it is working properly and post SQL statement generated.

Thats what i did the 1st time to get the current SQL statment that i have now...the only thing different about this one is the OR clause...but i will try it again
Jul 24 '07 #37
NeoPa
32,556 Expert Mod 16PB
Sorry, NeoPa I was just poking fun at the fact that you had asked about the data types when I had already done the same previously. So by jumping the gun I meant assuming one thing had not already been stated. We were both thinking along the same lines which is good. I didn't mean to confuse you nor insult. Just thought it was kind of funny, though my sense of humor may be a little off from lack of sleep. Now I see that I am the one who has jumped the gun and I think that's funny too.

Nevertheless! I do believe nulls are the issue here.
I agree with you.
EXACTLY how this manifests (and hence the best way to handle it) is something we can only know when Stang refers back to post #30, which refers back to post #26, which asks for (and says how to get) the SQL which causes the error message.
Here's hoping :D
Jul 24 '07 #38
Stang02GT
1,208 Expert 1GB
I agree with you.
EXACTLY how this manifests (and hence the best way to handle it) is something we can only know when Stang refers back to post #30, which refers back to post #26, which asks for (and says how to get) the SQL which causes the error message.
Here's hoping :D

I have revisited post 26 which then refers me to another post...which then refers me to another post lol after all that has gone on today for me my head is spinning right now and trying to follow the trail of suggestions of revisiting posts i have no idea what i am supposed to be posting for you guys to look at.

i've posted my code numerous time (Neo you know all about that lol ), the error message, and the original SQL statement were also posted.

I'm sorry for my ignorance and my down right lack of knowledge about these subjects, but VB is very new to me so i apologize if i am making you guys pull your hair out.
Jul 24 '07 #39
FishVal
2,653 Expert 2GB
I have revisited post 26 which then refers me to another post...which then refers me to another post lol after all that has gone on today for me my head is spinning right now and trying to follow the trail of suggestions of revisiting posts i have no idea what i am supposed to be posting for you guys to look at.

i've posted my code numerous time (Neo you know all about that lol ), the error message, and the original SQL statement were also posted.

I'm sorry for my ignorance and my down right lack of knowledge about these subjects, but VB is very new to me so i apologize if i am making you guys pull your hair out.
Acid trip. lol

If you want you are welcome to send me your db via e-mail available from my vCard.
Jul 24 '07 #40
JKing
1,206 Expert 1GB
Ok, let's take a look at everything provided thus far. With a little deduction you will see my conclusion at the end.

First SQL and it worked.
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO SRMisc ( [Tracker Item], Description, Comments, Requestor, [SR Num] )
  2. SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6
  3. FROM Tracker
  4. WHERE (((Tracker.Z6)="3918"));         
  5.  
SQL in VB still works
Expand|Select|Wrap|Line Numbers
  1. strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  2.            "Comments, Requestor, [SR Num] ) " & _
  3.            "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  4.            "FROM Tracker WHERE Tracker.Z6='" & _
  5.            Me.Text19 & "';"
  6.  
SQL in VB provides data type mismatch when adding or clause
Expand|Select|Wrap|Line Numbers
  1. strSQL = "INSERT INTO SRMisc ( [Tracker Item], Description, " & _
  2.            "Comments, Requestor, [SR Num] ) " & _
  3.            "SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker.Z3, Tracker.Z6 " & _
  4.            "FROM Tracker WHERE Tracker.Z6='" & Me.Z6 & "' OR Tracker.X5='" & Me.X5 & "';"
  5.  
SQL in VB removed single quotes still get error
Expand|Select|Wrap|Line Numbers
  1. "FROM Tracker WHERE Tracker.Z6=" & Me.Z6 & " OR Tracker.X5=" & Me.X5 & ";"
  2.  
This leads me to believe that Z6 is a text and X5 is a number...
So try this:
Expand|Select|Wrap|Line Numbers
  1. "FROM Tracker WHERE Tracker.Z6='" & Me.Z6 & "' OR Tracker.X5=" & Me.X5 & ";"
  2.  
This will hopefully work... I hope haha.
Jul 24 '07 #41
NeoPa
32,556 Expert Mod 16PB
Post #26 again then :)
Second paragraph.
...
We need to revisit posts #19 & #20 then.
Just a pointer to the request (#19) - which was for the SQL string rather than the code which creates it (which did prove some help though), and the code you posted (#20) which needed an extra line added.
To get the actual SQL string (as requested) add this line after your line #7 in post #20.
Expand|Select|Wrap|Line Numbers
  1. Important line missing from this point (Doh!!!)
When you run the code you should find the actual SQL string used in the immediate pane of the VBA window.
I suspect you'll find one of the values not set, but let's wait for the SQL before jumping the gun.
Having omitted the most important part of the post in #26 I'll add it here for you :embarrased:
Expand|Select|Wrap|Line Numbers
  1. Debug.Print strSQL
Hopefully, with the instructions included - it won't be so hard to follow.
Let me apologise again for being a numpty :(
Jul 24 '07 #42
Stang02GT
1,208 Expert 1GB
SUCCESS!!!! lol

it works

JKing this line of code worked....

Expand|Select|Wrap|Line Numbers
  1. "FROM Tracker WHERE Tracker.Z6='" & Me.Z6 & "' OR Tracker.X5=" & Me.X5 & ";"

I can't thank all of you enough for helping me out so much!!!!

Thank you all A LOT! :)
Jul 25 '07 #43

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.