Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. frothytoad

    Subtraction error

    Here is an odd thing that perhaps someone can help with. In an immediate window, type the following: ? 22.8 - 22.6 What you get is 0.199999999999 Now, it may have been a long time since my last math class, but I still can't help but to expect the answer 0.2. Anyone know why this happens...
  2. frothytoad

    Adding controls to a form and pointing to a field in TblDefs.Fields

    It seems like CurrentDB (which is a method on Application), rather than being a global object itself, is newly regenerated as an object reference every time it is invoked. I guess that makes some sense in the case that the application might utilize multiple databases, so the "current" one...
  3. frothytoad

    Adding controls to a form and pointing to a field in TblDefs.Fields

    Golom, My guess is that it is the local reference to the database (via db) that makes the difference. Does this modification to your code still work? Private Sub Command16_Click() Stop Dim f As DAO.Field Dim db As DAO.Database...
  4. frothytoad

    Adding controls to a form and pointing to a field in TblDefs.Fields

    PH, That seems to be the catch. Retaining a reference to the specific TableDef keeps the Field point from going out of scope. Thanks! -- Jeff
  5. frothytoad

    Adding controls to a form and pointing to a field in TblDefs.Fields

    Golom, This gets me one step further, but the variable still seems to immediately go out of scope. For example: Dim f As DAO.field Set f = CurrentDb.TableDefs("tblEquipment").Fields(0) Debug.Print f.name ...gives an "Object invalid or no longer set" error (runtime, 3420). Thoughts? -- Jeff
  6. frothytoad

    Adding controls to a form and pointing to a field in TblDefs.Fields

    Hello all, I have been running into two problems that have me completely stumped, and I am hoping someone can offer an answer for one or both. The first has to do with creating controls programmatically. For some reason, when I try to add controls to my form (in design view), it comes back...
  7. frothytoad

    validating text as numeric

    How about something like this: Public Function IsNum(ByVal InVal As String) As Boolean IsNum = (StrComp(Trim(InVal), Val(InVal), vbTextCompare) = 0) End Function
  8. frothytoad

    Deciding which sub to run

    You could set each function up with arguments regarding how far along the track of functions to follow and where to start. For example: sub CallingSub() Dim n As Long ' Number of subs to call Dim m As Long ' Starting point of subs to use - 1 ... SubSub1 n + m, m ... end sub ------...
  9. frothytoad

    Deciding which sub to run

    CallByName might work in this case if it is not a problem to have the subs be public. -- Jeff
  10. frothytoad

    Deciding which sub to run

    Well, one simple solution would just be to call the next subroutine from within the previous instead of the original. In other words, 1 calls 2, 2 calls 3, 3 calls 4, etc. That way, if the original calls 3, it will get 3 and 4 but not 1 and 2. -- Jeff
  11. frothytoad

    Customizing combobox scrollbar

    I have an application where I need an autocomplete combo box that is capable of holding a lot (like 10^5 or 10^6) of entries. Up to this point, I have created my own ActiveX control, based upon a standard combo box, and simply filled it in with small subsets of data for display purposes. It...
  12. frothytoad

    ADO vs. SQL

    Forgot to mention - I am avoiding SP's because I have been designing the application (which is pretty much single user, btw, but may be multi-user in the future) to work with multiple db servers with only very minor changes to the VB app (like just changing the connect string). -- Jeff
  13. frothytoad

    ADO vs. SQL

    Thanks for the feedback. The other question, now, is what happens when I need to do this a few hundred or few thousand times. One way I have an open recordset with which I can loop rst.AddNew's, the other way I have to send multiple commands to the server (of course, it may be that the ODBC...
  14. frothytoad

    ADO vs. SQL

    I have VB code that accesses a MySQL database, and am hoping that someone can educate me on the following issue. There are two methods that are immediately obvious to me (although I am sure there are many others, probably more clever) for updating the database. The first is to open a...
  15. frothytoad

    Assigning a connection to a recordset, to set or not to set

    Thanks! That is what I suspected was happening, but one never knows with MS... -- Jeff
  16. frothytoad

    Assigning a connection to a recordset, to set or not to set

    Here is an odd situation. I wrote a piece of code to open a new recordset. Starting with a previously opened connection: Set MyConn = New ADODB.Connection MyConn.ConnectionString = ConnString MyConn.Open the code to open the recordset looks like this: Set rst = New...
  17. frothytoad

    Arrays, Collections, insertion, and speed

    Excellent. Thanks!
  18. frothytoad

    Arrays, Collections, insertion, and speed

    Excellent solution, Hypetia! I never knew about CopyMemory. Let me ask a follow-on. Since my control will not know the number of array elements until each is added (except when I load them from a recordset, when at least I know how many will be added as a group), is there any reason this...
  19. frothytoad

    Arrays, Collections, insertion, and speed

    Thanks for the responses. A question for each: Sheco - The only problem I see is that it seems that I would no longer have an index to permit a binary search. Can you think of another way to quickly zoom in on an entry of interest with such a UDT? Golom - It seems that I would have a similar...

Part and Inventory Search

Back
Top