Search results

  1. D

    3 forms, one bit of code, use a module?

    Stuartam, a datatype mismatch, is usually trying to pass an argument, of different type, than variable. Is PackRef an integer or string? If have it syntaxed, assuming it's an integer. But, If it's a string... .Open "SELECT * FROM TBLPacks WHERE PackRef = " & iPackID & "'", cn, adOpenStatic...
  2. D

    3 forms, one bit of code, use a module?

    ...of course, you can pass the ID, as an argument also.... Public Function SaveState(vbasstate As String, iPackID As Integer) .... .Open "SELECT * FROM TBLPacks WHERE pkPacksID = " & iPackID , cn, adOpenStatic ... Public Sub save_Click() Call SaveState(asstate, Me.pkPackID) End Sub...
  3. D

    3 forms, one bit of code, use a module?

    Stuartam, Your method, should've updated the FIRST RECORD? It surprises me, that "It doesn't do anything" At All? You have to at least, be on the record you want to update.. .... With rs .Open "SELECT * FROM TBLPacks WHERE pkPacksID = " & Forms!frmPacks.pkPackID , cn, adOpenStatic...
  4. D

    3 forms, one bit of code, use a module?

    Ah, you are attempting to pass arguments, without passing correctly. You can eithjer, pass tghe values as arguments, or declarec them as public variables, or make an explicit reference. As arguments... Public Function MyFunction(vbasuid As String,vbpackref As String, vbasstate As String ...
  5. D

    Time calculation/coversion

    Markvand, you can not change the type on this. It will remain a string, even if you dim as variant. As long as you have, string characters in it, "min" & "hrs" etc..., it will result as a string. I would Dim as a Single type & format Accordingly. ElapsedHrs = (Int((ehrs + tdays) / 60) & "." &...
  6. D

    trbl with sending data

    I believe your syntax is incorrect... Forms(myarray(1)).[txtDate].Value = Me.ocxCalendar.Value DoCmd.Close End Sub Hope this helps, Good Luck!
  7. D

    3 forms, one bit of code, use a module?

    All you need to do, in order to run any sub or function, is to put the NAME OF THE SUB OR FUNCTION, not module (not that you did this), in your code, with arguments if applicable, where necessary. Of course, you used the Open Module Method, which resulted exactly as it should, but to run the...
  8. D

    Add items to multi-column listbox

    meboz, it's rather easy, you simply delimit each item, with a semicolon... lstAdd.AddItem "Hello;Wuz Up;Good Bye" this will add to 3 columns, on ONE row. If you have a 4 column listbox, the 1st 3 will be filled. If you attempt to add 5 items, only the 1st 4 will populate. So you must build...
  9. D

    New record on subform of subform

    Al, I don't have the time right now, to consider specifically, whet you're attempting...DoCmd.GoTo Record acNewRec. ..but, I would suggest possibly, An INSERT INTO SQL? While values from listbox, are been extracted, Run SQL... For x = 0 To lstBox.ListCount - 1 If...
  10. D

    Using Dcount with Query. Counts source table instead

    Hi Merecer, with all due respect, I'm surprised it's working at all, (as you said, it returns ALL records from the source table?), because, your syntax is incorrect in all cases. (not to dwell, I'm just very curious). This should work... Miscellaneous_Count = DCount("Customer_ID"...
  11. D

    isloaded problem

    A brief example, right out of one of my modules... If CurrentProject.AllForms("frmDictionnaire").IsLoaded Then DoCmd.Close acForm, "frmDictionnaire" Else DoCmd.OpenForm "frmDictionnaire" End If Hope This Helps, Good Luck!
  12. D

    How to force a new autonumber on acNewRec?

    Good point Pat, I believe i misunderstood the objective.
  13. D

    How to force a new autonumber on acNewRec?

    Tekime, I do this, from the Current Event of my Form. Private Sub Form_Current() If Me.NewRecord Then apartementID = .... hope this helps, Good Luck!
  14. D

    Move next rec

    Hi Livvie, As Surjer said... Private Sub cmdNext_Click() DoCmd.GoToRecord , "frmFormName", acNext End Sub ...removing 2nd aRGUMENT, will move form with focus (calling form).. Private Sub cmdNext_Click() DoCmd.GoToRecord , , acNext End Sub ...other constants acPrevious acFirst acLast acNew...
  15. D

    Calculations in Access

    Absolutely Pat, but, just so we don't confuse Niels, I meant DLookup, as opposed to a Query....wondering, if this will give him the results he wanted, in a less cumbersome manner? Hope so! but either way, Good Luck!
  16. D

    Calculations in Access

    niels, I agree with Vince. As another option, could you use DLookUp. Not knowing, how you plan to implement this process, I'll give a random example. Say a combobox chooses the product group... dim iMargin, iPurchase As integer iMargin = DLookUp("txtMargin", "tblMargins", "txtProject = '" &...
  17. D

    Invoice hour checking by date

    You can use the Date() function. Always returns todays date, in short date format. Dim dDate As Date dDate = Date Thus... dDate = 8/24/2004. So... If txtTicket Date = Date And StraightTimeHours <= 8 Then MsgBox "Good work Hombré" Else msgbox "You have more than 8 hours entered" end if...
  18. D

    Help with Search and/or FindNext

    Bear with me here dtburdick, In case this hasn't been considered. (I'd be surprised). A public variable, set to the control to be searched on. Option Compare Database Option Explicit Dim fSearch As Control Private Sub cmdFind_Click() Set fSearch = txtArtist fSearch.SetFocus DoCmd.FindRecord...
Back
Top Bottom