Search results

  1. M

    SQL query in VB - error

    Are you making a new table? You could just use SELECT INTO and make things simpler. Otherwise, post your error code.
  2. M

    Complex DLookup (well it is for me!)

    What's the problem you are having? Usually when you're using DLookup() you need to have the field being returned in a bracket. DLookup("[lngCurYear]", ...
  3. M

    Keep getting Error 91 For Loop not initialized error

    Technically the For loop has nothing to do with the .EOF It is the Do Loop that would not be recognizing it. It looks fine, though, try and compile. It could be that when it reaches the .EOF it is getting an error and going back to the SecondTry label. You might want to put another "On Error...
  4. M

    Where Condition Help

    Nevermind, got around it using the Nz() function in the field selector.
  5. M

    Where Condition Help

    Please don't criticize the naming, I've renamed to make the logic simpler to understand. I am trying to run a query based on the value of a textbox. Right now if the text box is empty it shows all the records. This is what works: SELECT A.ID, B.Weight FROM A LEFT JOIN B ON...
  6. M

    Checking Time Field

    More efficient code (and easier way to type) is: If txtjobEndTime & "" = "" Then It gets rid of a function call, removes a logical operation and performs only one search. It is easier for the computer to combine the data and check it once, then check two different conditions. With computers...
  7. M

    Keypress event problem

    Yes and I forgot to mention that the setting is only need for the KeyPress event. You can capture both the Enter and Tab keys in the KeyDown event handler.
  8. M

    Keypress event problem

    I just wanted to add to this. The tab key is a little trickier to capture, but the Enter key behavior can be captured just like any other key. In the control's Property window: Goto the tab called "Other" Change "Enter Key Behavior" from the default value to "New Line in Field" Once this...
  9. M

    Define how Access opens using VBA

    Search the forum for no right click. This issue has already been addressed. Additionally, search for no toolbars. You can turn off all toolbars through code when the form opens.
  10. M

    Dynamically Call Event Handler From String

    I really wish sometimes we would solve the problem at hand and not create a workaround. I appreciate the help, but I know how to make a workaround. I'm working on database efficiency and clean code right now. But more importantly, I'm researching a way to call the button's click event...
  11. M

    Dynamically Call Event Handler From String

    Doc, I really thought you would trust me on what I was doing :) I guess I'll have to use an example to demonstrate the dilemma - this might be long. Let's say I have a tabbed form and the tabs are broken out, let's say, by Coach and Athlete. Both tabs have Contact Information. When the user...
  12. M

    Dynamically Call Event Handler From String

    I've also tried CallByName Me.Controls("cmd" & sCtrl), "Click", VbMethod and Set objButton = Me.Controls("cmd" & sCtrl) CallByName objButton, "Click", VbMethod as well as CallByName objButton, "Value", VbLet, True
  13. M

    Dynamically Call Event Handler From String

    For some reason I didn't think this was possible, but I didn't want to throw all my cards away. Let's say I have a button called cmdButton and I would like to call cmdButton_onClick(). Does anyone know a way to do this by using a string. For instance, Dim sCtrl As String sCtrl = "Button"...
  14. M

    Trouble w/ DoCmd.TransferText

    Instead of storing the month day and year in separate variables, for something like this you can use one function call. E.g, Format(Now,"YYYYMMDD") or Format(Now,"YYMMDD"), depending on the format you want.
  15. M

    If Statement in a Pass-Through Query

    What baldy is sayin is right. more than likely your server will accept it because i believe the AS/400 uses iSeries SQL. The AS/400 is a DB2 database, right? MySql = _ MySql + _ "CASE WHEN UOM='E' THEN COST*QTY " & _ " WHEN UOM='C' THEN COST*QTY)/100 " & _ " WHEN UOM='M' THEN...
  16. M

    Pass Through Queries and Parameters

    Where are you trying to pass parameters to? Dim qry As DAO.QueryDef Set qry = "" qry.SQL = "" qry.Parameter = ""
  17. M

    Pass Through Queries and Parameters

    Calling two replace functions, is a waste of proc cycles and memory. Why not just do this to begin with: strSQL = "SELECT * " & _ "FROM table1 " & _ "WHERE " & _ "field1 = " & intF1 & " AND " & _ "field2 = '" & strF2 & "'"
  18. M

    How to do function, then procedure w/single OnClick

    Public Sub CmdButton_OnClick() Call FunctionName Call Procedure_Name End Sub That's the logic. Now, you probably have it set up right, but you'll need to post your code to demonstrate your problem. Make sure you're using "DoEvents"
  19. M

    suppress error messages (2)

    warnings are mainly for editing tables. you're going to need an error handler. search for "error handler" or "on error goto" for example code.
  20. M

    Attach Label to Control

    Yeah I know the cut and past thing, but I had already formatted and renamed them all; I kinda wanted to avoid rework. I'll try the Compile technique next time, however I believe compiling only works for VBA. I'm not sure how to recompile the database outside of VBA.
Back
Top Bottom