Search results

  1. N

    Excel Sheet to Maximize thru VBA code

    Try putting the following into your code after making the workbook visible. objxl.ActiveWindow.WindowState = xlMaximized Also, I suggest you make the application visible after opening the workbook. so final code looks like: Set objxl = New Excel.Application Set objwkb =...
  2. N

    Kindly Sugesst

    ... sorry, date format should be mm/dd/yyyy (I left out the extra yy in my earlier response):rolleyes:
  3. N

    Kindly Sugesst

    What is in fields Text1.Text and Text2.Text? These need to resolve to dates in the form mm/dd/yy for the query to work. Try a Debug.Print of your SQL statement just before you execute it to see what the resolved string looks like.
  4. N

    Question Set the position of an API Color Chooser

    The answer you need is in the thread - the response from spikepl on 02-19-2012, 11:20 AM says to "google windows api position dialog", which will return the following link (amongst others) http://msdn.microsoft.com/en-us/library/windows/desktop/ms632595(v=vs.85).aspx. The answer is in there, but...
  5. N

    Mixed Date Formats

    Are you talking about a single column of dates in the SQL source? If so, it's likely that the dates were entered wrongly in the first place. In what way do the dates appear - do you mean "mm/dd/yyyy" and "dd/mm/yyyy"? If so, how do you know that these are reversed for a date like 06/04/2011 - is...
  6. N

    Re: Need Help

    Re: Need Help So how do you want to relate these fields? If you give an example of your data in context, then describe what you need to achieve, we might be able to help. I simply don't understand what you want to do! :-(
  7. N

    Question Set the position of an API Color Chooser

    Have a look at this thread: http://www.access-programmers.co.uk/forums/showthread.php?t=222022
  8. N

    Kindly Sugesst

    Yes, much better! :)
  9. N

    View Text rather than ID in calculated field

    How is 'Advertising' related to '100'? Is the former a text field in a table whose key is 'Activity'? If so, give us details of the table and we can help with the relevant query.
  10. N

    Sorting by date.

    ... and to format the date when you have the Date/Time field, you need Format(datefield,"dd/mm/yyyy") to get it the way you want it in any display context. As plog says, this is independent of the actual data field content.
  11. N

    Kindly Sugesst

    Where are Text1 and Text2 defined and what are their values when the error occurs? You don't need the 'like' SQL keyword and the comarison should be '>=' the first date and '<=' the second date to retrieve the range.
  12. N

    The code gives wrong result.

    If you put a listbox on your form and name it lsbDates, then change the loop to fill it as follows: Dim datStart As Date, datEnd As Date Dim i As Integer, j As Integer datStart = Combo0 DatEnd = Combo2 Rem remove any existing entries from listbox Do While Me.lsbDates.ListCount > 0...
  13. N

    The code gives wrong result.

    ... And of course you can tell it's untested - my comparison for dates in the loop is the wrong way around ... Try Do While datStart < datEnd
  14. N

    The code gives wrong result.

    To do this, you need a loop. Something like this: Dim datStart As Date, datEnd As Date Dim i As Integer, j As Integer datStart = Combo0 DatEnd = Combo2 Do While datStart > datEnd i = DCount("username", "tbldata", "not username is null and [Date GoneAway Received] = #" &...
  15. N

    Age old issue maximizing

    Which version of Access are you using? If 2007 or 2010, the default mode is tabbed windows, where the DoCmd.Maximise doesn't work as you expect. Turn off tabbed browsing in the 'this database' options as a first suggestion.
  16. N

    Passing a reference to a control on a subform to a function

    You are very welcome!
  17. N

    The code gives wrong result.

    What is the value returned from Combo0? If you're not sure, put a breakpoint at the first DCount statement and inspect the value of the crieria string. Alternatively, display the combo box value in a msgbox. What I'm thinking is that the Format statement is trying to work on a value it doen't...
  18. N

    Passing a reference to a control on a subform to a function

    If I understand you correctly, the call should be Call Function(Me, Me.ctl) when placed in the subform because the form in which the code is located (i.e. the subform) is the 'Me' in question and the 'ctl' belongs to it. Begs the question why you need the form Id at all - just pass the control...
  19. N

    help plz

    It looks like you have most of the problem solved. To populate the remaining fields, you need to include them in the INSERT statement, using values you have stored elsewhere (those you list are in the SMS_IN table, by the look of it. It may be better to have a Customer table which holds the Id...
  20. N

    Passing a reference to a control on a subform to a function

    Presumably the subform in question is a child to your main form in which the Call staement is done? Also the new call you want to make is from that subform code? If so, the call should look like this: Call Function(Me, Me.Parent.ctl) Is ctl the name of a control on your main form or is it a...
Back
Top Bottom