Using Dlookup to populate form fields

15 pts.
Microsoft Access
I have a simple database with one table(Issue log). What I want is a form that allows for creating a new "issue" within the table or updating the status of an existing issue. I want the form (Issue log) that will update an issues' status to auto-populate based on which issue number you enter. Example: I open the form and put 10 in the issue number line in the form and the other fileds populate based on the entry for 10 in the table. I'm currently trying to use Dlookup but I can't get my syntax right. Here's what I've entered: =DLookUp("[Issue name]","Issue log","[Issue number= " & [Issue number]) Also, I want to eventually make the form pupoulate based on the most recent entry for an issue based on the date stamp in the table. Any help would be greatly appriciated

Answer Wiki

Thanks. We'll let you know when a new response is added.

I think you will need to provide some more details, such as what is the database and programming language you are using in order to get some useful responses.

Best regards,

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Dave40
    Sorry. I'm using Access 2003 and I'm trying to avoid programming language if possible (I'm just using out of the box features for now).
    15 pointsBadges:
  • Randym
    if you typed as: =DLookUp("[Issue name]","Issue log","[Issue number= " & [Issue number]) You are missing a ] in the where parameter [Issue number=; Also, you need brackets for your table if it has a space in it: [issue log]. Note that if these auto populated fields will be stored in the database, you will not be able to have the DLookup in the control source. You will need a macro or VBA code to populate the fields using the DLookup
    1,740 pointsBadges:
  • Rbrown38059
    I wouldn't use DLookup for this. I would create this as a Menu Item form: I would create a query to pull the record I want with a prompt for the operator to enter the record number to edit as follows: [Enter Record number you want to edit] This line would go in the criteria block for the query under the field that contains the record number. You could then use a macro to open the form using this query as the filter. The data mode would be 'edit'. Create a second macro to open the form for data entry. There would be no filter & the data mode would be 'data entry'. This should open the form with no data in it. Create a form with 2 controls: 1st control = new record, 2nd = edit record & link each control button to the appropriate macro. This will hopefully help you not have to do much coding. I may have missed something in this translation since I am fairly new to Access myself. I have used this technique on simple one-table databases & it works pretty well. Good luck
    85 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: