Search results

  1. B

    I am trying to Loop through Subform and Test two fields

    That's good, your welcome.
  2. B

    query duplicate problem

    Post your DB and I'll make the edit.
  3. B

    query duplicate problem

    You'll need to customize the formula (thus no longer making it universal) to return your values. Here is the customized version with changes in red: Public Function ConcatRelated(strField As String, _ strTable As String, _ Optional strWhere As String, _ Optional strOrderBy As...
  4. B

    query duplicate problem

    Public Function ConcatRelated(strField As String, _ strTable As String, _ Optional strWhere As String, _ Optional strOrderBy As String, _ Optional strSeparator = ", ") As Variant Not knowing your tables, you are passing the function the name of the field you want concatenated...
  5. B

    query duplicate problem

    Actually, you would no longer include the fails table in your query. The function takes care of that by passing the PKID.
  6. B

    Autofill relationship needed for primary key

    Good to hear you worked it out. :)
  7. B

    Need Help with code

    After setting the recordset, try adding: Set rstMail = db.OpenRecordset("tblEmail", dbOpenDynaset) rstMail.MoveLast rstMail.MoveFirst Also, if you are using the tblEmail as your recordset why are using Dlookup and not referencing the fields directly from the recordset? With MailOutlook...
  8. B

    I am trying to Loop through Subform and Test two fields

    Is there a reason you don't have this test in the subforms Before Update event? Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.cmb_ActionCode = "Pending" And IsNull(Me.cmb_PendingDesc) Then Cancel = 1 MsgBox "When the Pending Action Code is selected you must select a Pending...
  9. B

    Autofill relationship needed for primary key

    Each of your subforms needs to have the recordsource based directly on the table, not a query. Also, the System ID No control for each subform should be locked to prevent inadvertent data entry.
  10. B

    To know if same value in the field already exists

    The code is set up to only check when you are creating a new record, not when you are editing an existing record. If you want it to fire any time, remove the test for Me.NewRecord.
  11. B

    Autofill relationship needed for primary key

    How is your data entry form setup? Do you have the Engine table as the record source for the main form and subsequent subforms for each of the remaining tables? If not, you should set it up that way so you can take advantage of Master - Child linking which would automatically fill in the...
  12. B

    To know if same value in the field already exists

    You can use Dcount() to see if there are any other entries with that dob and if so open a report based on your table maintable only listing those entries. Place the code in the forms Before Update event. If Me.NewRecord And Dcount("*","maintable","[DOB]=#" & Me.DOB & "#") > 0 Then Msgbox...
  13. B

    Split Function

    Thanks for the info Paul.
  14. B

    query duplicate problem

    What you would like to do is concatenate the fails into a single list and that can be done using VBA. If you give me the primary key for the task table and foreign key for the fails table I could give you an example function. Edit: I see Paul is already got you on that. Good Luck.
  15. B

    Split Function

    Replace: With: PostValCol2(x) = Mid(MyArray(x), InStr(1, MyArray(x), "-") + 1, Len(MyArray(x)))
  16. B

    Custom autonumber with year and month

    You would use the code in an [Event Procedure] which would be the choice Code Builder. If you are having today's date default then it will not fire since there is no data entry. You can place the code in the forms Before Insert event and it will fire immediately upon entering a new record...
  17. B

    Split Function

    Since you are passing an array, try this code: Function DoubleSplit(MyArray As Variant) Dim PostValCol1(1000) As String, PostValCol2(1000) As String Dim x As Integer, PreArray As String, PostArray As String, strval As String 'example 'Call DoubleSplit(YourArray) For x = 0 To UBound(MyArray)...
  18. B

    Split Function

    How are passing your array? Please show me how you are using the function.
  19. B

    Split Function

    Here is a function that can preform that task. What you do with the results is up to you. Function DoubleSplit(StrVal As String) 'example 'Call DoubleSplit("1-a,2-b,3-c,4-d") Dim PreVal() As String, PostValCol1() As String, PostValCol2() As String Dim x As Integer, PreArray As String...
  20. B

    Custom autonumber with year and month

    I'm assuming the user is entering a date into a bound control so you could put this code into the after update event for that data control and have it fire only if it is a new record (or you could do so if the autonumber is null etc.). Dim MonthCount As String If IsDate(Me.DateEntered) And...
Back
Top Bottom