473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

OpenForm based on combo box in a continuous subform.

I have a form [Formulas] with a continuous subform [Formulas - Raws].
subform has a combo box called [lot#}

I have a separate form called [COA - Quick Information].
The following code is opening up the [COA - Quick Information] form,
but is not applying the "Where" clause which is based on the combo box
I double click on the subform.
([COA - Quick Information] form opens up blank)

Here is the code.

Private Sub lot__DblClick(Cancel As Integer)
DoCmd.OpenForm "COA - Quick Information", , , "lot =
'[Forms]![Formulas]![Formulas - Raws].[Form]![lot#]'"
End Sub

Any suggestions would be appreciated.
Doug

Nov 13 '05 #1
4 1769
Rename the field Lot# !!!
Then...
[Lot] = Forms!Formulas.[Formulas - Raws].Form.Lot"

And before it gets any worse, I'd suggest renaming anything that looks
like [Formulas - Raws] to something like FormulasRaws.

There's a lot of info out there on standardized naming conventions

Nov 13 '05 #2
Concatenate the value into the WhereCondition string:
DoCmd.OpenF... , "lot = """ & [lot#] & """"
or drop the extra quotes if Lot# is a Number type field (not a Text type
field:
"lot = " & [lot#]
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@daubert.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I have a form [Formulas] with a continuous subform [Formulas - Raws].
subform has a combo box called [lot#}

I have a separate form called [COA - Quick Information].
The following code is opening up the [COA - Quick Information] form,
but is not applying the "Where" clause which is based on the combo box
I double click on the subform.
([COA - Quick Information] form opens up blank)

Here is the code.

Private Sub lot__DblClick(Cancel As Integer)
DoCmd.OpenForm "COA - Quick Information", , , "lot =
'[Forms]![Formulas]![Formulas - Raws].[Form]![lot#]'"
End Sub

Any suggestions would be appreciated.
Doug

Nov 13 '05 #3
I know with older versions of Access, there were isssues with field
naming......

I use Access 2003 and was under the impresison that this was no longer
an issue.

Are your points about the naming a REAL issue or just a programmers pet
peeve..........
Doug

Nov 23 '05 #4
If you use a field name that starts with a number or contains a space or
character such as #, you will have to use square brackets around the field
name wherever it occurs, in SQL statements and in VBA code. That's an
annoyance factor for "real programmers."

The field names that will cause you real grief are those that match the name
of a property or reserved word, such as Name or Date. Nearly everything has
a Name property, so when you refer to the Name field on the form Access
confuses it with the name of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@daubert.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I know with older versions of Access, there were isssues with field
naming......

I use Access 2003 and was under the impresison that this was no longer
an issue.

Are your points about the naming a REAL issue or just a programmers pet
peeve..........
Doug

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
3
by: NB | last post by:
Let's say in the product table I have around 50,000 products (well, infact it has now about 2000 only, but it's growing very fast, hence the question here) In the order form, users will select...
15
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
1
by: UrKo | last post by:
Hi all, First let m say that i did search and found lots of answers to my problem and have solved it partial. I have a main form that include subform. I needed to get the data from combo box...
9
by: cocacrispy | last post by:
I've read many forum posts and articles and haven't made any headway with this. Let me describe my tables and when I'm trying to do and see if any one can help me. I have an items table, a...
3
by: victoria.rego | last post by:
Hi there, My application is generating a "The OpenForm action was cancelled" error and I can't seem to figure out why. The best part about it is that it's only one user in the entire building -...
0
by: vljones | last post by:
Hoping to find a way of entering new data into a combo box which contains a list of items contained in a table. In addition I want to allocate an ID number to entries that are not currently in...
2
by: franc sutherland | last post by:
Hello, I am using Access 2003. I have a query which shows a list of club meetings sorted by date. This query is displayed in continuous forms, in a subform. I would like to select a month on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.