Display record on form by serching subform table
I have a laptop database that tracks laptops and current laptopholders
the database is written in access 97
I have organised this in to a number of tables primarily Laptop and laptopholder
I have a form that is based on Laptop
I have a sub form based on laptopholder
the serial number is the primary key
my main form shows records based on the laptop table
my subform displays the latest occurrence of a loan for that laptop and the record selector on the sub form cycles through from latest loan to oldest loan of that particular laptop
I want to search through the laptop holder table using the laptopholders name rather then searching through the current records available on the subform, which are limited by the current laptop being displayed....if you follow that.
the reason I want to this is so I can get the laptop serial number that they currently hold. I could filter the query using IsNull in the returned date I want to further filter the query by name
to do this I thought to allow the database user to select a name from a drop down list or combo box oon the main form
then my query would return all users with that name who have a Null value in date returned (hopefully one)
I was then going to take the serial number and therefore the record number of the laptop and using this display that laptop on my main form....if this makes any sense
I don't know if this is the best way to do it or not but I want a button on my form that when they enter a user name the laptop the user is holding will be displayed and if not they get a message saying user does not hold a laptop at this time
this or anything similar would be fine
I have used a mix of macro's VBA and expressions to build this database
Mainly making headway by trail and error
I have a laptop database that tracks laptops and current laptopholders
the database is written in access 97
I have organised this in to a number of tables primarily Laptop and laptopholder
I have a form that is based on Laptop
I have a sub form based on laptopholder
the serial number is the primary key
my main form shows records based on the laptop table
my subform displays the latest occurrence of a loan for that laptop and the record selector on the sub form cycles through from latest loan to oldest loan of that particular laptop
I want to search through the laptop holder table using the laptopholders name rather then searching through the current records available on the subform, which are limited by the current laptop being displayed....if you follow that.
the reason I want to this is so I can get the laptop serial number that they currently hold. I could filter the query using IsNull in the returned date I want to further filter the query by name
to do this I thought to allow the database user to select a name from a drop down list or combo box oon the main form
then my query would return all users with that name who have a Null value in date returned (hopefully one)
I was then going to take the serial number and therefore the record number of the laptop and using this display that laptop on my main form....if this makes any sense
I don't know if this is the best way to do it or not but I want a button on my form that when they enter a user name the laptop the user is holding will be displayed and if not they get a message saying user does not hold a laptop at this time
this or anything similar would be fine
I have used a mix of macro's VBA and expressions to build this database
Mainly making headway by trail and error
Last edited by a moderator: