Hi,
I'm using the following code to open a form on a specific record. I have a form displaying records in a list which then allows users to click onto the record to open it up in a new form in a single view. -
DoCmd.OpenForm "FRMBookingDetails", , "[BookingID] = " & Me.BookingID
-
The form opens only on the first record only and never the chosen record. Sometimes it opens the form on a new record.
I'm guessing this has something to do with filtering but not sure what i should be checking for.
Thanks.
8 31316
I would be checking to ensure the form you are opening up has the field [BookingID] somewhere within its record.
Other than that it could be an issue with your form properties set wrong usually Allow Filter = false etc
Thanks munkee.
That was my first thought. But filter setting are set to true and i have the PK BookingID on the form.
I changed the code to the following and it seems to be working again now, not sure why. -
DoCmd.OpenForm "FRMBookingDetails", acNormal, , "[BookingID] = " & Me.BookingID
-
Weird. I wouldnt have expected adding the acnormal to change anything unless you have some properties set up within you form to only open in design view :| which once again I wouldnt expect.
The acNormal is the default value, so I doubt that the change there is what fixed the problem.
I have noticed on occasion that if I have the form open in design view, and then switch to normal view, that I do not get the same behavior as if I had closed the form, and then reopened it.
That's a good point SmileyCoder. I've just noticed the same thing. Even if you make sure you save the changes sometimes there can be unexpected events if the form is not closed and then reopened.
I've only noticed this with DoCmd.OpenForm, but perhaps this effects other functions.
When ever i get any strange things happening i'm going to try this from now on.
I think you are missing a ' in your first example
You say -
DoCmd.OpenForm "FRMBookingDetails", , "[BookingID] = " & Me.BookingID
-
Should it not be -
DoCmd.OpenForm "FRMBookingDetails", , ,"[BookingID] = " & Me.BookingID
-
I think Lysander has a good point, exept that he meant to type , and not '. In your second example where you included the acNormal, you had the correct amount of [,].
Sorry should have copied and pasted instead of writing it out. I do have the correct amount of commas in my code, but well spotted. Thanks SmileyCoder
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ian |
last post by:
I want to open a form at a particular record, but I think I'm running
into problems because the recordsource query is executing
asynchronously.
In the form's open event I use...
|
by: Chris |
last post by:
Hello all. I have a database that I use to send email updates to
people. Everything is working fine, but one suggestion I keep getting
is to add a link to the automatic emails that will open up the...
|
by: nkoske |
last post by:
I have a form with a subform in datasheet view and I have a event on
one of the fields in the subform, so that the user can double click it
and go to expanded information based on that field.
...
|
by: Jpipher |
last post by:
Let me explain what I am trying to accomplish...
Two forms -- we'll call them "Main" and "Related"
A command button on "Main" runs a union query.
The union query results are shown in "Related"...
|
by: kev |
last post by:
Hi folks,
I have a form for registration (frmRegistration) whereby i have two
buttons. One is Save which saves record using the OnClick property. I
used wizard to create the save button. The...
|
by: DavidB |
last post by:
I want to be able to go to a specific record on my form when I open
it. The record I want to go to will be dynamic based on the value
currently stored in a global variable. The global contains...
|
by: getro |
last post by:
Hi Everyone,
I need to open an Access 2003 form to a specific record from a custom Outlook 2003 Appointment form. The form has a command button that would pass a record id to access and open the...
|
by: Martin Bentler |
last post by:
Right now, I have a form, locked records, on which I have a CommandButton that opens a second form (much like the first) but open for editing, plus allowing the user to manipulate other areas of the...
|
by: cvillav |
last post by:
Hello, I am new to Access and this forums,
I have two tables and two forms to display the data.
Tables
Tbuilding
Tcriteria
Forms
fmbuilding
|
by: eko99312 |
last post by:
Let's say I have this form called Attendance List. The list was in datasheet form. In the list there were names and date checklist. The question is, I want to edit one of the names by double clicking...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |