hi fneily,
i delected the
Dim var_profil_1 As Integer
Dim var_profil_2 As Integer
it obviously is not integer (maybe i try long or something later)
and now it works perfect!
so thanks a lot
and have a nice evening or what time you'll probably might have
Stefan
hi fneily,
i added your recommendation - and it worked well (there occured a mistake nr. 6, but thats due to wrong variable declaration i think [PROFIL_ID is sometimes longer i expect])
here is the full code:
Sub COPY()
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim...
hi aceman1
thanks for your input - i declared the variables and simplified the code a bit to emphasize the real problem
Sub COPY()
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim var_pre_trim As String
Dim var_post_trim As String
Dim var_profil_1 As Integer
Dim...
herewith i want to emphasise, what i do not unterstand:
access (the compiler?) complains that there is no recordset in recset2
but i do not tell him, that he should jump into a new line?
if the PROFIL_IDs are equal, access should just edit the old row of recest2 with the values of recset1 and...
hi i have a code, that doesnt work - but i don't know why, since the structure seems logical to me.
in the following i will post the code and make some annotations on it (so i try to communicate, what i think the code means for the compiler)
Sub COPY()
Dim rs1 As DAO.Recordset
Dim...
OH YEAH, it works - THANK YOU SO MUCH
Sub COPY_SQL()
Dim strSQL As String
Dim var_xxx As String
var_xxx = "1_1_1_1"
strSQL = "INSERT INTO Duplication_Test ( " & _
"KATALOG_ID, PROFIL_ID, CONCAT, SWERT ) " & _
"SELECT KATALOG_ID, PROFIL_ID, CONCAT, SWERT " & _
"FROM Working_Table_KAP1 " &...
i tried to outwit access but it didnt work
Sub COPY_SQL()
Dim strSQL As String
Dim x As String
var_xxx = "1_1_1_1"
strSQL = "INSERT INTO Duplication_Test ( " & _
"KATALOG_ID, PROFIL_ID, CONCAT, SWERT ) " & _
"SELECT KATALOG_ID, PROFIL_ID, CONCAT, SWERT " & _
"FROM Working_Table_KAP1 " & _...
My code is the SQL, are you saying you have decided to go with that?"
yes - i tried it with the numeric variable (as a test) and it worked well but access refuses my text-trials
WHERE CONCAT = 1_1_1_1 "
"WHERE CONCAT = "1_1_1_1" "
"WHERE CONCAT = '1_1_1_1' " which i expected should be the correct one
"WHERE CONCAT = '"1_1_1_1"' "
"WHERE CONCAT = ("1_1_1_1") "
"WHERE CONCAT = `1_1_1_1` "
but none of them worked
nono,
the doesnt work was referring to my old code - i actually try yours and it worked at least with the numeric variables (at my code i had to delete the rs2.MoveNext and the rs2.MoveFirst as well, so that it worked again - but also not for the text-columns)
but why does it only work with numeric variables?
If var1 = 34 Then ... works since var1 is a numeric variable,
but
If var3 = "1_1_1_1" doenst work - beides var3 is a text string
hey, thanks a lot for your guideline
Sub COPY()
Set rs1 = CurrentDb.OpenRecordset("SELECT * FROM Working_Table_KAP1")
Set rs2 = CurrentDb.OpenRecordset("SELECT * FROM Duplication_Test")
If Not rs1.EOF Then ' And Not rs2.EOF
rs1.MoveFirst
rs2.MoveFirst...
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.