Is there any recordset action going on when it opens from the command button? What differs when it's opened via the button vs opened from the database window? If something else is going on in the process, you may wish to use DoEvents after DoCmd.OpenForm... or in the form's Open or Load event...
Anyone know about working with the mouse scroll? In a certain form, I want it to scroll a text box when it's in it. I don't want it scrolling records. I've found articles about turning the mouse scroll off, but I want to tell it work with the textbox when the textbox has the focus.
Not sure I understand clearly, but here's what I can say. Sounds like you already know how to get the 1 in query1. When you construct the textbox, use the Name property. Me.<textbox>.Name = "txtbox" & n
Also,
Me.Controls("<name>" OR index).Name = "txtbox" & n
Use DoEvents when it should update. When you work with recordsets, Access seems to like finish the recordset work before doing anything with the display. DoEvents says, "Let everything else finish before continuing."
There is a FAQ about DoEvents concerning progress bars.
Ah, I see. Select a number of random records. That may be a little more complicated. A less practical way might be to set a recordset to the file/table, then randomly go to a record (rs.Move Rnd(),1) and copy it into another recordset. This would allow a record to be repeated, however, unless...
If I understand correctly, you want to open a percentage of records from a table and assign random numbers for them. Since the first function assigns to all records, it wouldn't be useful for this. You could actually just put the code in Yadda, but, if you want SetTmpRndNbr to be able to assign...
To reference a control by variable:
Me.Controls(var)
or
Form_frmName.Controls(var)
Control properties may be used with this reference also (Me.Controls(var).Name).
You can use a similar method for referring to a form or report by variable.
CurrentProject.AllForms(var).Name...
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.