Search results

  1. D

    Query based on combo box selection

    I have just realised that I am making this database more complex than it ought to be and I don't need to create that bit I was asking about. Thanks anyway guys. Dave
  2. D

    Query based on combo box selection

    This is the row source: SELECT [Town].[TownID], [Town].[TownName] FROM [Town] ORDER BY [TownName];
  3. D

    Query based on combo box selection

    Hi, I have a form that has a query embedded on the form in a sub form. I then have a combo box on the form that I want to filter the query results depending on the town I select from the combo box. In the query, I have the TownID from the town table, with the criteria...
  4. D

    You can't go to the specified record

    I have a problem but it is not a consistent one. I have a form that has a new button on it that is meant to create a new record but when I click it, it sometimes gives me the error "you can't go to the specified record". The weird part is that it sometimes will create a new record but other...
  5. D

    Query criteria

    Sorry if I sound a bit ignorant, but I don't know much about coding. With the code you gave me, what do I need to replace with names from my database and what do I replace them with? Thanks, Dave
  6. D

    You cannot add or change a record because a related record is required

    Here is a working copy of the database.
  7. D

    Query criteria

    I am having some trouble specifying query criteria. I have a table called tblDivisions which has the fields ID and tblDivisionsTown. I have another table called Legatees. Each legatee is from a town and I have another form that contains a sub form to show the legatees from a given town. The sub...
  8. D

    You cannot add or change a record because a related record is required

    Sorry about not including the instructions but it has suddenly started working today. I have no idea why but it works now. Thanks anyway, Dave
  9. D

    You cannot add or change a record because a related record is required

    I have a problem and I can't figure how to fix it. I have made a database and I am not sure what I have done as I used to be able to enter new information easily but whenever I try and enter new records now, I get the message You cannot add or change a record because a related record is required...
  10. D

    Passing data to another form

    If I wanted to learn how to code like this in Access, do you have any recommendations of where I could go?
  11. D

    Passing data to another form

    Thanks again for that Steve, I tried to work it out myself and I broke it and I wasn't sure what I did so thanks for giving me all the code to paste back in to make it work.:D
  12. D

    Passing data to another form

    Thanks Steve, works perfectly. One more question, if no record is selected when the edit button is hit, it throws back an error. How do I change the code so that it just displays a msg box asking you to select a record?
  13. D

    Passing data to another form

    I have a list box that filters the search results as you type and I want to be able to select a record from the list and press another button and for the data entry form to appear so I can edit info on that record. The code I have behind the button you click is DoCmd.OpenForm "widow", acNormal...
  14. D

    Opening a form to view and edit information on a selected record

    But what do I need to put in there? This is the code I currently have. Private Sub Command36_Click() Dim sWHERE As String 'Comment out or delete the line that does not apply -- ''If the ID is a number, built the WHERE clause like this: sWHERE = "[WidowID] = " & Me.SearchResults ''If...
  15. D

    Opening a form to view and edit information on a selected record

    Thanks for that suggestion, the link has this as one of the suggestions which I thought sounded like what I was looking for: Creating an SQL statement to display records matching the ID of the current form Often you will want to open a form and display records matching the ID of the...
  16. D

    Opening a form to view and edit information on a selected record

    I played around with the code and I think it is meant to be something more like this, but it still won't work. DoCmd.OpenForm "Widow", acNormal, , "[WidowID] = " & Me.SearchResults where widow is the name of the form that is meant to show the widow information.
  17. D

    Opening a form to view and edit information on a selected record

    The link you posted didn't really make sense but I found another link https://access-programmers.co.uk/forums/showthread.php?t=119456, which seemed to have what I was looking for but it didn't work using the line of code recommended, DoCmd.OpenForm "[FRM_SearchMulti]", acNormal, ...
  18. D

    Opening a form to view and edit information on a selected record

    I may have overlooked it but I couldn't see the answer there. I also can't code very well so I don't understand coding if the answer was written in some code. I just remember that it is possible as I have done it before but I can't remember how I did it.
  19. D

    Opening a form to view and edit information on a selected record

    I have a form to search through a database and on the form, a listbox with row source: “SELECT QRY_SearchAll.WidowID, QRY_SearchAll.WidowName, QRY_SearchAll.WidowStreetAddress, QRY_SearchAll.WidowPhone, QRY_SearchAll.WidowMobile, QRY_SearchAll.WidowDOB, QRY_SearchAll.tblDivisionsTown...
  20. D

    Data entry form to open relating to selected record when a button is pressed.

    I have a list box on a form called SearchResults and I want to be able to click a button and for the data entry form to appear for the record that is currently selected in the list box so a record can be edited. How do I do this?
Back
Top Bottom