Search results

  1. D

    No value given for 1 required parameter

    Hi Howlsta, you only seem to be passing one value in ( tblStudent.UBNumber = txtUB ), if i've gone blind and can't see the second post back . As you refer to it as a number you need to change your SQL line to read - strSQL = "SELECT tblStudent.StudentIDF from tblStudent where...
  2. D

    Nth select

    pleasure, it's nice to write some code to do something i've not done before, especialy when it does something useful for someone. And a special thanks from me to The_Doc _Man, without whom we'd now be knee deep in queries and functions, thanks mate Drew [This message has been edited by Drew...
  3. D

    While a form is open......

    Hi Irie, sorry for the delay in responding, i thought i'd tidy the code a little before i came back to you. Here's the slightly better version Public Sub OpenAForm(strFormName As String) On Error GoTo OpeningError Dim strHide As String strHide = Screen.ActiveForm.Name...
  4. D

    Nth select

    i was thinking random was what you were after and i would have thought it more statistically valid but i'm not a statistician either. v.khawaja's post above will pick you every 5th record out rather than a random selection. The code i wrote could select the first 200 records and no others...
  5. D

    Nth select

    sorry, that wasn't very clear. You should end up with 2 seperate subs. One as Sub changeYN(bytPercSel As Byte) and one as Sub RunTheThing(). Then when you want to run it, put yourself into the Sub RunTheThing() one and either hit F5 or the play button on the top on the Visual Basic toolbar (...
  6. D

    Nth select

    you're welcome, they're not silly questions ( not to me anyhow, the only stupid question is the unasked one ). Okay:- 1/ In a module - just cut and paste. Doesn't matter if it's a new one or not, up to you. 2/ depends where you want to call it from. If you're just doing this db for yourself...
  7. D

    SQL in VBA

    easiest is probably to make intID public, the function will be able to return it then HTH Drew
  8. D

    if-then statement in criteria

    Hi Robbin, rather than do it in the criteria you want to do it in the Field of the query. You would put in something like - SodiumLevelIs: iif([SodiumField]<135 Or SodiumField>145,SodiumField,"-") HTH Drew
  9. D

    Nth select

    erm, bad news on that one i'm afraid - i broke my linux box the other day, i'm planning to do a fresh install tonight but may not have time to set everything up. Can u post here?
  10. D

    Problems with Random Numbers

    Not unless you/they add 2 records in the same second. But then why not drop the rnd and just use the dt string alone? - you could always format it to look random, Drew
  11. D

    Need Help on building an expression, first time expression builder.

    Hi, I haven't checked the logic or even read this post very well but i think the correctly bracketed version would be IIf(IsNull([% To Objection]), "No Data Available", IIf([% To Ojection] < 100, "D - Needs Development", IIf(([% To Objection] > 99.9) And ([% To Objection] < 115), "M -...
  12. D

    Problems with Random Numbers

    Random generates numbers seeded from the current date - that's how you get the same number so many times - you need to call Randomize in order for it to get going properly. Jacks autonumber is the best solution unless you really do need a random number, in which case you'll have to generate it...
  13. D

    While a form is open......

    sorry to chip back in again, but <soapbox> this is why it's better to use the tag, that way it doesn't matter what form calls another, it'll just go back to the last one. You don't need any more code to cope with it and you can change the name of your forms and only have to change the open...
  14. D

    Nth select

    Morning Manu, Working with Docs idea above here's some code that will mark the records as selected Sub changeYN(bytPercSel As Byte) Dim rst As Recordset Dim dbs As Database Dim x As Integer Dim lngTotalRecords As Long Dim lngNumToSet As Long Set dbs = CurrentDb...
  15. D

    Nth select

    Okay, i'm off home shortly but will pick up again tomorrow. Where to go next depends on how you want to use the data - do you just want to print a report or do you want to be able to manipulate it further? Catch u later Drew <extra bit> I like Docs post above, but Rnd either needs to be...
  16. D

    Nth select

    Of course. Having looked at your question again i'm not sure my answer was really what you're after. It will return you the top so many records rather than a random selection. If that's what you're after then: Assuming you have your query written which pulls all the data that you want a...
  17. D

    Nth select

    hi manu, you need to use a syntax like "SELECT TOP n myTable.ID..." in your query, HTH Drew [This message has been edited by Drew (edited 08-22-2001).]
  18. D

    Select case

    Hi Rich, this Select Case sType Case "Existing" Select Case sNum Case Is = 1 getrptperiod = 1 Case Is = 3 getrptperiod = 1 Case Is = 2 getrptperiod = 1...
  19. D

    Help/Error Messages

    Hi Howslta, you need to reference the column of your text box that contains the value you want to display, like me.cboModule.column(1) if your friendly display name is the second column in the box, HTH Drew
  20. D

    Deleting Multiple Records

    There'll be a smart way to do this but the quickest is probably to make a new table with Cert and Job as a compound primary key and then just run an append query - it'll reject any duplicates for you. Nice and easy HTH Drew
Back
Top Bottom