Search results

  1. B

    multiple recordets in a sub

    Hi is it possible to declare and use multiple rescordsets inside one sub? eg. Dim rst1 As DAO.Recordset Dim rst2 As DAO.Recordset Dim sql1 As String Dim sql2 As String sql1 = blah sql2 = blah blah blah (some code) rst1.Update rst2.Update ? i tried this, but its not working...have i...
  2. B

    Global Variables in VB

    do i have to declare the variable in each subj I use it in as well as the initial declaration?
  3. B

    Global Variables in VB

    thats what I had done originally...i put it right up the top in the Option Compare Database bit but its not holding the values i assign to it ?:confused: Bella
  4. B

    Global Variables in VB

    Mile-O-Phile how do u declare a form level variable?? Bella
  5. B

    Global Variables in VB

    Hi, does anyone know how to declare and use global variables in VB? Eg, I have an integer variable called temp1 which i need to use in two different subs. - in sub1 when i use the variable, I assign an integer value to it - in sub 2 when i use the var iable i use its value in an SQL string...
  6. B

    What is wrong with this code? strings in VB

    Woo hoo!! Hi guys, THANKS! - it finally worked :) My year groups problem - i still dont get it - but i fixed it, typing in the Year Group Values into the combo box, instead of getting those from a table as I had done b4. thanks heaps :) !! Bell :D
  7. B

    What is wrong with this code? strings in VB

    Hi there :) thanks for your help its greatly appreciated. I stil have some questions/problems: 1. When i run the code it compiles but right down the bottom where we say: rst.Update it tells me that it cant update Year_ID values, because these do not exist in the linked Year Groups table...
  8. B

    What is wrong with this code? strings in VB

    hi sorry if this is a super dumb question, but in the following line of code: If Me.kla = "Creative Arts" Then rst!KLA_ID = 1 does: Me.kla refer to the combo box called kla that the user selects on the form? and rst!KLA_ID refer to the field in the Subject List table which i am trying...
  9. B

    What is wrong with this code? strings in VB

    Wayne Hi Wayne, I did that, and its now giving me the following error: Run time Error 2428: "You entered an invalid argument in the domain aggregate function" and the denugger points to : > rst!w = DMax(SL_ID, "[Subject List]") + 1 w is not refereceing something that the user enters or...
  10. B

    What is wrong with this code? strings in VB

    Reply to Wayne Hi, i cut and pasted this code her but it gives me an error: "Run time Error 13 Type Mismatch" and then the debugger has the yellow arrow pointing at: >Set rst = dbs.OpenRecordset(sql) ?? :( Bella...
  11. B

    What is wrong with this code? strings in VB

    reply to Wayne Hi Wayne or anyone else out there... thanks for your code, but i realised i did not explain my question properly - I have a text box, and 2 combo boxes (call them x, y, z) and they all store text values. I need to put those text values into a table called Subject List which...
  12. B

    What is wrong with this code? strings in VB

    reply to Ancient One HI Ancient One, ->We need the names of the fields where the values go and the -->names of the combo boxes and text boxes, please. 1. The fields where the values go are called: SL_ID, Subject Name, Year_ID and KLA_ID (in that order) 2. The Names of the combo boxes (all...
  13. B

    What is wrong with this code? strings in VB

    HI, Can someone please tell me how to write the following in VB - using all the right syntax. I am using DAO and i cant make it work. I'm getting syntax errors :(:(:( "Insert into [table]" & _ "VALUES (w,x, y,z)" &_ Where: 1. x is a string that the user types into a text box on a form 2. y...
  14. B

    VB Syntax Question

    Hi, sorry for this very dumb question but: Cam some1 please tell me what the following operators refer to in VB, and how to use them. I am getting syntax errors so I must be doing something wrong. when do you use ' in an SQL expression? when do you use " in an SQL expression? When do you...
  15. B

    how to use a value from a combo box in a report

    Hi, can anyone tell me, if there's a way to put a value that a user selects from a combo box in a form into a report? EG. The report has a field called Names which it needs to get from a Combo box on a form that stores various values for Names (eg. Bella, Bob, Jane, etc) So, if the user...
  16. B

    how to return a value from a query to a variable?

    DAO recordset?? Hi Tim/anyone else out there, thanks for your recordset advice. I am having a problem though, that my vb compiler wont recognise this line: Dim rst as new.adodb.Recordset I dont know how to install the ADO library - I am using DAO as I am not sure if my version of access...
  17. B

    wot is the ! operator referring to in VB?

    Hi, I've seen this syntax used in code samples, but I'm not very familliar with VB syntax, and I am wondering if the following means : IF a table (Table Name) has a field (Counter) and Counter contains a value of 3 Then strQueryName = "Report 3LO" Elseif blah blah... Is this wot this bit of...
  18. B

    how to return a value from a query to a variable?

    Hi Can anyone tell me if its possible to create an Access Query and then put one of the fields returned in that query into an Integer variable ? i want to say something like: SELECT x,y,z FROM X,Y,Z WHERE blah blah & blah; and then in VB code something like: Dim CounterVariable As Integer...
Back
Top Bottom