I have been stuck for some time on this now.
I have this code at the moment -
DoCmd.OpenForm "Form1", , , "Apps= '" & Form!App_Name & "'"
-
Both fields Apps and App_Name are Bound to the same field (text) which is primary key. With the current code I get box where it asks for value of Apps. I have tried changing where condition in different ways, also with me.App_Name but with no result. On some debugs it shows that it finds the right value but it just don't use it! It works fine if I enter the value in the box or write it in hard code: Apps = XXXXX.
I am using Access 2000.
Any ideas what could be the problem?
13 3595
Hmm, puzzled why you have two fields bound to the same field.
Normally when this is the case, one field will be named "Apps" and the other e.g. "Text1" as Access won't allow two fields on a form to have the same name.
The popup asking for the "Apps" value is an indication that the field "Apps" isn't found, thus you'll need to check the names of the formcontrols (See the Name property under the "Other" tab of the property window.)
Nic;o)
Sorry I must have explained it badly.
The button is locates on the form called List1 and has a field called App_Name. So when the button is pressed I want it to open a form called Form1 in which field Apps should display the same value as was in App_Name. They both are bound to the same field in table but they are on different forms.
The names I am using are correct, I have double checked all of them...
Sorry I must have explained it badly.
The button is locates on the form called List1 and has a field called App_Name. So when the button is pressed I want it to open a form called Form1 in which field Apps should display the same value as was in App_Name. They both are bound to the same field in table but they are on different forms.
The names I am using are correct, I have double checked all of them...
-
-
DoCmd.OpenForm "Form1", , , "Apps= '" & Me!App_Name & "'"
-
-
-
DoCmd.OpenForm "Form1", , , "Apps= '" & Me!App_Name & "'"
-
Tried that... still asks to enter value for Apps.... tried also with me.App_name. I tried also some with setting Me!App_Name/Form!App_Name as a seperate criteria and debugger showed that it recognizes the value but it was not using it...
Tried that... still asks to enter value for Apps.... tried also with me.App_name. I tried also some with setting Me!App_Name/Form!App_Name as a seperate criteria and debugger showed that it recognizes the value but it was not using it...
Are you sure you are mixing up your table field names and control names here? the Do.cmd.OpenForm command I posted is syntactically correct.
Check that your table field names and Control Names match ie NOT where you have the NAME of a control as Apps on Form1 make sure it is the same as the controlsource and try it again.
When you make a call like that to "Apps" it is expecting 'Apps' to be a field name in the underlying table on which to base its SQL comparison if you do not have a TABLE field called explicitly 'Apps' then this is why is will prompt you because the field doe not exist
Jim
Check form1 for the field you assume to be "Apps" by checking the Name property under the "Other" tab of the property window when the "Apps" control is "active" in design mode.
Nic;o)
OK here is what I have:
List_1 - form which contains text box - App_Name (control source - Interface)
there is also the button with which I want to open form - Form1
On Form1 there is also a text field called Apps (control source - Interface)
So I want after the click to open Form1 where in Apps text box will be the same value as App_Name in List_1 form.
Also I was looking through the code and found some code, which I believe was auto generated and I am not using but seems to be for similar purpose. -
stLinkCriteria = "[To]=" & "'" & Me![App_Name] & "'"
-
Hope this helps
OK here is what I have:
List_1 - form which contains text box - App_Name (control source - Interface)
there is also the button with which I want to open form - Form1
On Form1 there is also a text field called Apps (control source - Interface)
So I want after the click to open Form1 where in Apps text box will be the same value as App_Name in List_1 form.
Also I was looking through the code and found some code, which I believe was auto generated and I am not using but seems to be for similar purpose. -
stLinkCriteria = "[To]=" & "'" & Me![App_Name] & "'"
-
Hope this helps
Try this:
1) Open "Form1" in design mode.
2) Single click on the field "Apps"
3) Press Properties button (Hand with white sheet)
4) In properties window under the "Other" tab look into the first propertyline (Name) and tell what's listed there.
Nic;o)
Good.... got it working sort of... needed to use control source... I did not know that, so now it filters only to selected record.
Thanks Jim and Nico...
But it seems that I need something a bit more complicated then that for my other form.
On the third form I have unbound list box, which has the same control source as previous. And I have a Subform. So how do I filter the subform while still having full list in the list box? alternately could also just make selection in list box.
Thanks again for explaining to use control source and hope you can help o this as well...
When you use the wizard to place the subform, it will ask for a linking field. Just accept the proposed field and Access will sync the subform with the keyvalue of the mainform.
When the mainform is filtered, the subform will also be filtered accordingly.
Nic;o)
That is the thing. I did not use wizard for that... I linked the subform to the listbox on the main form. and the listbox in not bound. Listbox is there purely for selection purpose which then filters the subform. The main form does not even have a Record Source or anything like that...
If that is too complicated or requires me to change a lot... then don't worry.. #Got at least some of it working thanks to you... should be good enough...
Thanks...
I will have a look at those on Monday... Time for me to finish off the working say
Appreciate you help!!!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Nothing |
last post by:
I have a form that the user types in a last name to search for then
clicks a search button.
Based on the information I want to open the form using the SQL Where
statement that will pattern match...
|
by: beowulfs |
last post by:
Here's what I've got:
I've got a form with combo boxes. you can select already existing
company names or type in new ones. if you type in a new one, it
prompts you to double click the combo...
|
by: Lyn |
last post by:
Hi,
I have been experiencing a problem passing a LIKE statement in the WHERE
argument of a DoCmd.Openform statement. I have posted that issue
separately.
However, in an attempt to work around...
|
by: dhowell |
last post by:
I have a form with a continuous subform .
subform has a combo box called .
The following code is opening up the form,
but is not applying the "Where" clause which is based on the combo box...
|
by: Mike Charney |
last post by:
I am trying to write an Open Form command in VBA with a where clause in it.
I need to be able to do two different where clauses:
1) With a between in it: i.e. Between Date1 and Date2 or...
|
by: SDL |
last post by:
Help!
I have a system that was running fine and I was testing a bottom level
form. I went from a menu to a screen where I could enter a phone number
or name to find a customer. If the customer...
|
by: kevooo5 |
last post by:
I use Access 2003 and I'm having trouble setting the wherecondition for the Openform functions.
Usually it would look something like this
DoCmd.OpenForm "Contact", , ,wherecondition here
I...
|
by: gavm360 |
last post by:
Hello, im trying to open a form from an dialog box form:
the button on the dialog box has this on the onclick event:
DoCmd.OpenForm "frmCASES_UNION", acViewNormal, , "MCH_CASECODE = #" &...
|
by: rik |
last post by:
I am trying to build an Access 2002/2003 database application that I
would like to offer to other writers so they can track submissions.
Just trying to make a helpful tool for writers, poets, or...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |