By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

Navigation Form --> Where Clause fails

P: 2
Navigation form ("frmNavigation") --> SubForm ("subFormNav")
Contains "frmContract" with ID "[ContractID]

BrowseTo is working well, but the Where Clause "[ContractID]=182003" fails
It just opens with the first Record.

What I am missing?

Thanks a lot
Apr 10 '19 #1
Share this Question
Share on Google+
5 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,282
On the one hand.... I hate Navigation Forms. They add increased complexity to a simple process.

Would you mind posting the actual VBA you are using for this procedure? That might hepp. One ofmy thoughts was that your ContractID might be text value, but in thae case it wouldn't return any records. Is the form "filtering" the first record only, or showing all records but just displaying the first record? That also might hepp.

On the other hand.... I hate Navigation Forms. They add increased complexity to a simple process.

Don't know if that hepps....
Apr 10 '19 #2

NeoPa
Expert Mod 15k+
P: 31,489
Where and how are you using the Where clause?
Apr 12 '19 #3

P: 2
At first thanks for the quick responses.

The Target form is "frmContract". It is not filtered.
The Target Record is "ContractID" as Long

From the Searchform (also a Navigation Form) SearchButton_OnClick the next code
Expand|Select|Wrap|Line Numbers
  1. DoCmd.BrowseTo acBrowseToForm, "frmContract", "frmNavigation.navSubform", "[ContractID] = " & [ContractID]
The destination form "frmContract" opens in the Navigation form

However, the first record shows. Not the required record.
Browsing is possible, so no filter is set
Apr 12 '19 #4

NeoPa
Expert Mod 15k+
P: 31,489
I'm afraid I can't help much with that. It looks fine to me but I can't check if you have the right values specified in your Method arguments.

Typically I prefer object-relative code rather than interface stuff such as DoCmd etc. Maybe try filtering the form itself if you want just that record available, or use Me.Recordset.FindFirst to navigate to the desired record. Obviously if running from a main form then the reference to the actual form would need to be changed to reflect where it is.
Apr 13 '19 #5

twinnyfo
Expert Mod 2.5K+
P: 3,282
My only thought is that this is somehow related to the Navigation Form functionality of Access. I've heard of others having similar problems to this when using the BrowseTo Method and filtering for a particular record--even though the method is designed to use this.
Apr 13 '19 #6

Post your reply

Sign in to post your reply or Sign up for a free account.