[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Using Where Conditions To Open Form

Posted on 2012-08-18
Medium Priority
Last Modified: 2012-08-18
I have a form that has an option to add a comment. Everything is fine when I am adding a new comment, but when I want to look at a note associated with a particular record in my form, I am having problems with the where condition.

As it stands, I am unable to add any extra fields to any of the tables, so the notes associated with a record have to in some other way be linked.

I know I can use the edit note command button to open the form with a certain where condition. The problem is that I continue to get an error when I try to open the form to a certain record.

I attached a copy of the Form with the relevant tables. What I would like to happen is the following

1) When a note is attached to a record on the form click the edit command.
2) When the notes form is opened, have it reference the batch form to know where to go

Attached is a copy of the form. If you select 2F125 there is a note attached to it, however, I cant seem to get to it.

Let me know if there are any other questions, thank youNotesSampleDB.accdb
Question by:jleval
  • 2
LVL 77

Expert Comment

ID: 38307526
The data is in a different file.  This is just the frontend.

Author Comment

ID: 38307530
Sorry here is the complete database
LVL 40

Accepted Solution

als315 earned 2000 total points
ID: 38307639
PartNumber is text field and your code should be:

DoCmd.OpenForm "frmNotes", , , "[PartNumber]='" & Me.PartNumber & "'"
DoCmd.OpenForm "frmNotes", , , "[PartNumber]=" & chr(34) & Me.PartNumber & chr(34)

Author Closing Comment

ID: 38307980
DoCmd.OpenForm "frmNotes", , , "[PartNumber]=" & chr(34) & Me.PartNumber & chr(34)

Worked perfectly, Thank you

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question