posted on Aug, 16 2005 @ 12:18 AM
It sounds like you're trying to create a form to do that. If you wanted it to be in table format, you would type something like:
SELECT * FROM tablename WHERE PName = PErsonName
As long as PersonName isn't defined anywhere, a dialog box will appear asking you to specify what value PersonName has.
If you're doing it in a form, use the form building wizard based on your query. Then, where patient name is, add a button. Edit the code behind the
button after you name the text field "txtName" or something, and put:
dim rs as New ADODB.Recordset
rs.open "SELECT * FROM Person WHERE PName = '" [note the tick -- ' ] & txtName & "'", [not sure what goes here in Access. It should prompt you,
but this is where you put what connection you want to use in VB. Not sure about VBA]
Then you would populate your text fields:
txtLoaned = rs!Loaned
txtType = rs!LaptopType
etc.
Note that it is the field name that follows the rs!, and it
is case sensitive. If this doesn't work or you have more questions, I'll be
around. I'm subscribed to this thread now