Search results

  1. rockman

    how to use a form of another db

    Jumping in here to suggest something... I've never opened a form from a different database, but this link may help. A possible work around involves linking the table. Your statement "I dont want to link tables, having different db is a need" doesn't necessarily compute. You can still have...
  2. rockman

    detect if a record is stored in a 2nd table

    Glad to hear its working. Good luck with the rest of your project. -Jeff
  3. rockman

    detect if a record is stored in a 2nd table

    The code that Wayne provided should do the trick. Your example uses a command button so it should look something like this: Private Sub cmdBuyBook_Click If Not IsNull(DLookUp("[BookID]", "TakenBooks", "[BookID] = " & txtcode.value)) Then MsgBox("That book is already out.")...
  4. rockman

    Lists

    Not sure if this will help, but if you can generate a string that contains the HTML code I think this will work: Private Function MakeLinks(sHeading as String, sFooting as String, iMaxMembers as Integer) as String Dim i as Integer MakeLinks = sHeading & vbCrLf For i = 1 to iMaxMembers...
  5. rockman

    Parameters in a QueryDef

    Perfect Kevin! Your way is much more elegant than what I was able to come up with. Thanks a million, Jeff
  6. rockman

    Parameters in a QueryDef

    I found a round-about way to accomplish this, but it sounds like your way is more straight forward. Please expound upon "pass the parameter to the form before it opens". Thanks
  7. rockman

    Relating Values In Other Tables

    The SQL statement would be placed within the Before Update event of your txtName and txtDate on your frmBooking. Note: It is good programming style (no, essential programming style) to use prefixes for tables, fields, queries, controls, etc... There are a number of suggested prefix lists out...
  8. rockman

    Relating Values In Other Tables

    Your SQL will look something like this: "SELECT fldName FROM tblBookings WHERE fldName = '" & txtName & "' AND fldOutingID = " & txtOutingID & ";" If the recordcount is greater than 1, you know that it is a double booking and you can tell the user so.
  9. rockman

    Relating Values In Other Tables

    Looks like you have a bug in your code. Try typing this in your Imediate Window: If DateValue("3/3/64")>DateValue("4/12/76") then Print "Greater" else Print "Lesser" If the above code works on your system then its your code that you need to debug. -Jeff
  10. rockman

    Relating Values In Other Tables

    First, you won't be comparing information in the tables directly. It is much easier to compare textboxes on forms based on the tables involved. When you get far enough into MS Access, you will find you can create direct comparisons of tables but that is much more involved. If you are wishing...
  11. rockman

    Relating Values In Other Tables

    1. The dates should work as I understand your structure now. 2. VBA is key to making anything but the most rudimentary databases. Welcome to your endeavor. DSum info is explained in the Help file. You will need to use an If...then...else construct in VBA in order to compare number of seats...
  12. rockman

    Relating Values In Other Tables

    1. To be clear, it would be helpful to me to list the fields in each table. From your answer, I assume that each "Outing" can have multiple "Bookings". 2. On your Booking form place a textbox (txtChairsFilled) that has its ControlSource equal to a DSum function. Look up DSum in the help file...
  13. rockman

    Relating Values In Other Tables

    Question #1: It sounds like your database structure may be bad. What is the relationship of tblBooking to tblOuting? If they both refer to like excursions then DateOfOuting should be in the same table/record of DateOfOrder. Question #2: You can perform a query with a domain aggregate...
  14. rockman

    Parameters in a QueryDef

    Kevin- Thanks for the reply. Its obvious that you are accomplishing exactly what I would like to achieve. I don't quite understand your statement "pass the parameter to the form before it opens". I was able to place the CustomerID number in a textbox on my "Customer Select" form, and then...
  15. rockman

    Parameters in a QueryDef

    Question about parameters in a querydef Pat Hartman has stated that it is more efficient to use a querydef than dynamic SQL. I've read over his post of HowJetHandlesQueriesAgainstODBCDatasources.doc, but I have questions. I have a form "frmCustomer" and I have a querydef "qryCustomer" based...
  16. rockman

    Using a field value as criteria

    Thanks for your replies dcx693 and dgm. I got the self-join query to work before I saw dgm's post. Dgm, I thought that I had tried your way but obviously I had something screwed up because your code works flawlessly and is much more elegant than a self-join query. Thanks again, Jeff
  17. rockman

    Using a field value as criteria

    This is just a succinct example. My actual SQL string is: SELECT selPatients.fldPatientID AS [Patient ID], selPatients.fldFullName AS [Patient Name], tblClinics.fldName AS Clinic, selPatients.fldTypeOrReason AS [Follow-up Type], selPatients.fldFollowupDate AS [Follow-up Date]...
  18. rockman

    Paramater type query

    Try using the LIKE operator. Criteria: LIKE "*" & [SearchString] & "*" Hope this helps, Jeff
  19. rockman

    Using a field value as criteria

    I couldn't find an answer to this in the archives, but it seems fairly straight-foward to me: How can I use a field value as criteria? Example: Let's say I want a select query to return all records where the person's first name is the same as the person's last name. In a querydef, the...
  20. rockman

    VbMsgBoxSetForeground

    Thanks for the reply The_Doc_Man, but I'm not "seeing the light". I searched these forums and VB Help for "Modal Dialog" and found nothing to help me answer my question. I am intrigued that you say that one can open a non-modal MsgBox. I didn't think this was possible. Perhaps if you tell me...
Back
Top Bottom