Method or data member not found

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm having trouble with the above error message when trying to insert a new
record. I am using the following code...

sSQL = "INSERT INTO Tbl_Ball_By_Ball (Date_Time, Over, Actual_Ball,
Ball, Batting_Team, Batsman_On_Strike, Batsman_Non_Striker, Bowling_Team,
Bowler_Bowling, Bowler_End, Bowler_Other)"
sSQL = sSQL & " VALUES ('" & Format(Now(), "General Date") &
"',1,1,1,'" & Me.cbo_Batting_Team & "','" & cbo_Batsman_On_Strike & "','" &
cbo_Batsman_Non_Striker & "','" & Me.cbo_Bowling_Team & "','" & cbo_Bowler &
"','" & Me.cbo_Bowler_End & "','" & Me.cbo_Bower_Other & "');"

.... and I always get the error message on cbo_Bowler.

I have tried renaming the control box as well as trying to repeat the
control before it but again it errors at the same point. Is there a limit
with the length of the statement?

I've tried and tried and tried.....
 
Hi,

I'm having trouble with the above error message when trying to insert a new
record. I am using the following code...

sSQL = "INSERT INTO Tbl_Ball_By_Ball (Date_Time, Over, Actual_Ball,
Ball, Batting_Team, Batsman_On_Strike, Batsman_Non_Striker, Bowling_Team,
Bowler_Bowling, Bowler_End, Bowler_Other)"
sSQL = sSQL & " VALUES ('" & Format(Now(), "General Date") &
"',1,1,1,'" & Me.cbo_Batting_Team & "','" & cbo_Batsman_On_Strike & "','" &
cbo_Batsman_Non_Striker & "','" & Me.cbo_Bowling_Team & "','" & cbo_Bowler &
"','" & Me.cbo_Bowler_End & "','" & Me.cbo_Bower_Other & "');"

... and I always get the error message on cbo_Bowler.

I have tried renaming the control box as well as trying to repeat the
control before it but again it errors at the same point. Is there a limit
with the length of the statement?

There is, but you're nowhere near it.

There is no variable named cbo_Bowler. Try doing as you've done on the
other form controls and use Me.cbo_Bowler.

John W. Vinson[MVP]
 
Hi John,

Thanks for your reply. I saw that error myself after posting it and the
problem remains. I've tried everything - any other ideas?
 
Hi John,

Thanks for your reply. I saw that error myself after posting it and the
problem remains. I've tried everything - any other ideas?

Hm. Problem remains at what step? What error message do you get? If
you step through the code and type

?strSQL

in the Immediate window, what does the SQL string look like?

John W. Vinson[MVP]
 
I've typed that (?sSQL actually) and then clicked on the button to execute
the code. I'm prompted with an error box 'Compile Error: Method or data
member not found"

I've also placed msgbox sSQL in the first line but never get to it as I get
the error first.

As I said earlier I have tried different variants (including the previous
variant and it goes to the same location) with the same result.

Uhhh!!!
 
Hi,

I'm having trouble with the above error message when trying to insert a new
record. I am using the following code...

sSQL = "INSERT INTO Tbl_Ball_By_Ball (Date_Time, Over, Actual_Ball,
Ball, Batting_Team, Batsman_On_Strike, Batsman_Non_Striker, Bowling_Team,
Bowler_Bowling, Bowler_End, Bowler_Other)"
sSQL = sSQL & " VALUES ('" & Format(Now(), "General Date") &
"',1,1,1,'" & Me.cbo_Batting_Team & "','" & cbo_Batsman_On_Strike & "','" &
cbo_Batsman_Non_Striker & "','" & Me.cbo_Bowling_Team & "','" & cbo_Bowler &
"','" & Me.cbo_Bowler_End & "','" & Me.cbo_Bower_Other & "');"

... and I always get the error message on cbo_Bowler.

Do you get the error *while executing this code*? or before, or when?

I don't know if it's just a typing error, but you have cbo_Bowler and
cbo_Bower_Other (no l - is that part of the Christmas season? No L, No
L?)

John W. Vinson[MVP]
 
Well picked up. I've made the change but no change. CXan I email it to you
- it is only 374KB.
 
Well picked up. I've made the change but no change. CXan I email it to you
- it is only 374KB.

Only if you'ld like me to email you my current consulting rates and
set up a contract. Sorry.


John W. Vinson[MVP]
 
Hi,

I'm having trouble with the above error message when trying to insert a new
record. I am using the following code...

sSQL = "INSERT INTO Tbl_Ball_By_Ball (Date_Time, Over, Actual_Ball,
Ball, Batting_Team, Batsman_On_Strike, Batsman_Non_Striker, Bowling_Team,
Bowler_Bowling, Bowler_End, Bowler_Other)"
sSQL = sSQL & " VALUES ('" & Format(Now(), "General Date") &
"',1,1,1,'" & Me.cbo_Batting_Team & "','" & cbo_Batsman_On_Strike & "','" &
cbo_Batsman_Non_Striker & "','" & Me.cbo_Bowling_Team & "','" & cbo_Bowler &
"','" & Me.cbo_Bowler_End & "','" & Me.cbo_Bower_Other & "');"

... and I always get the error message on cbo_Bowler.

I have tried renaming the control box as well as trying to repeat the
control before it but again it errors at the same point. Is there a limit
with the length of the statement?

I've tried and tried and tried.....

Try stepping through the code and verifying that all of the cbo_...
values in fact contain what you expect them to contain, and that sSQL
becomes a valid SQL string. One concern (though it shouldn't give
*this* error) is that a Date/Time field should be delimited by #
rather than by '. Also double and triplecheck the names of all the
controls.


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top