is this possible? reload a form that is based on a query with new query that is defined in the form.

I have a basic form.

The form is based on a query, so when I open the form, a pop comes up
where I enter in what I want to query.

So instead of 30,0000 records, I get 1-10 records.

on the form, I have a text box. I want to be able to enter in what I
want to query next and afterupdate have the recordset/form reload with
that query instead of my original qeury.

I figure this has to be done with VB. I am just starting to learn some
VB but I am lost.

Any info would be great, thank you.

0
mgworek
3/30/2007 2:37:20 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
1592 Views

Similar Articles

[PageSpeed] 46

It does.
You need to apply the new query or table name, or the sql string to
the forms recordsource, then requery the form. Basically
in the even that needs to cause the change (usualy the AfterUpdate of
a control or the Click of a button)..

Me.RecordSource = "[table/query/sql]"
Me.Requery

Or you can look into using the form filter instead. The filter though
needs to be based on an underlying query or table. If the query or
table itself needs to change then use the former method.

0
storrboy
3/30/2007 2:56:48 PM
thank you for the reply. If I changed the RecordSource would i just
put  Me.RecordSource = "[SELECT whatever FROM whatever WHERE whatever
= whatever.TEXT]" ?

On Mar 30, 10:56 am, "storrboy" <storr...@sympatico.ca> wrote:
> It does.
> You need to apply the new query or table name, or the sql string to
> the forms recordsource, then requery the form. Basically
> in the even that needs to cause the change (usualy the AfterUpdate of
> a control or the Click of a button)..
>
> Me.RecordSource = "[table/query/sql]"
> Me.Requery
>
> Or you can look into using the form filter instead. The filter though
> needs to be based on an underlying query or table. If the query or
> table itself needs to change then use the former method.


0
mgworek
3/30/2007 3:01:49 PM
Without the [ ] and the .TEXT property will depend on wether or not
the change is made before the control is updated and what the datatype
is. For a string value after the control is updated it would be

Me.RecordSource = "SELECT whatever FROM whatever WHERE whatever
= '" & formcontrol & "';"

formcontrol.Value can be used as well.

0
storrboy
3/30/2007 4:32:09 PM
Reply:

Similar Artilces:

Inventory posting for new year before running year end?
Hello, What happens if we post inventory transactions for new year without performing year end for 2008? Thanks, MS When you close inventory for 2008, beginning quantities are updated. If you've posted 2009 transactions, they will be included in the 2008 beginning quantity. There are a handful of inventory reports that use the Beginning Qty field, such as the Inventory Turns report. Hope this helps, Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com blog: www.gp2themax.blogspot.com Thanks Frank... Did you mean to say the posted transaction will be incu...

Is it possible
I would like to know is it possible to make million dollar in the internet, if you have any suggestions, write on my forumhttp://isitpossible.truemillion.comMark...

Outlook Forms????
I created a form, however, there is a message page, with the To:, From: ect. & a Page 2. I really don't want the form to be 2 pages. How can I get everything onto the message page. This way a user does not have to click the P2 tab to fill in the form. Cut and paste the controls on Page 2 to the main message page. FYI, there is a newsgroup specifically for Outlook forms issues "down the hall" at microsoft.public.outlook.program_forms or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_forms -- Sue...

Personal Folders in OWA
Hello, I have just enabled OWA on our Exchange 2003 SP2 through ISA Server 2004. Is there any way to access personal folders in OWA? Thanks in advance. If by personal folders you mean .pst files, the answer is NO! Sorry. C C wrote: > Hello, > > I have just enabled OWA on our Exchange 2003 SP2 > through ISA Server 2004. Is there any way to > access personal folders in OWA? > > Thanks in advance. > > "C C" <someone@atsbcglobal.net> wrote: >I have just enabled OWA on our Exchange 2003 SP2 >through ISA Server 2004. Is there any way...

Subform/Form Referencing
I have a Subform that resides on numerous Forms. I have a calculated field on the Subform that references a field on the Form. [Cost] - Forms.FormName.[Cost] As I place the same Subform on other Forms, the reference is now incorrect because the Form Name has changed. What coding would I use to replace Forms.FormName so the subform will reference the Current Form and display values correctly? Any help appreciated! Newer, Try... =[parent].[Form]![Cost] Tested OK for me, with a subform field that got it's vale from City on my main form. -- hth ...

Adding a Secondary Owner Field in Contact form
Hello Everyone!! I would like to know if someone can help me with this... Is there any way to create a copy of the ownerid field to have more than one possible owner to each contact??? I have added a new field called: owner_02 to Contacts entity but it is a nvarchar so the user can add any text and it should be better if it is the same type than ownerid field. Any help will be appreciated!! Thanks and regards, Pablo Hi Pablo, There is no easy way to achieve this. You could add a separate entity which gets filled automatically based on callouts on Systemuser. Then create a lookup t...

Downloading Statements Directly Not Possible
I have Money 2002 installed on an Win XP Pro SP1 machine. Something happened and I probably did it, that causes the statement downloads not to go directly to the account. Rather they want to be saved in a file and then opened into Money. I then have to delete the download. I have tried several things in order to fix this: 1. I verified the file associations of OFC, OFX were correct. They were. 2. Lowered all my security settings in IE. Even put banks into Trusted site zone. No go. 3. Made new accounts. Didn't help. 4. My IE cache is large (500MB) and regularly cleaned out. 5. I made s...

form calculation not showing in table
Hi i have a table with loan amount and charges which add up to create a balance which is also a field in the table. i have created the form for this table and created the calculation for the balance field to add up the loan amount and charges. The calculation on the form adds up correctly, the problem is that i dont understand why the balance data is not going into the balance table. the loan amount and charges inputted on the form is being entered onto the table, yet the balance is not. Can someone tell me what i am doing wrong, or if i should be doing it a different way. thanks in ...

is this possible? reload a form that is based on a query with new query that is defined in the form.
I have a basic form. The form is based on a query, so when I open the form, a pop comes up where I enter in what I want to query. So instead of 30,0000 records, I get 1-10 records. on the form, I have a text box. I want to be able to enter in what I want to query next and afterupdate have the recordset/form reload with that query instead of my original qeury. I figure this has to be done with VB. I am just starting to learn some VB but I am lost. Any info would be great, thank you. It does. You need to apply the new query or table name, or the sql string to the forms recordsource, then...

unrelated table in a query
I am using a query with several tables, linked with one to many relationships. There is one table in there that is not related to any other tables. I contains a single record and I use a form on opening the database to set parameters on it (start date and end date). I use this table to set conditions on the query, then I use the query for about 10 reports. I haven't had any problems with the query (although the reports run slow). Is there any reason I should not set it up this way? I have to start a new project and would like to repeat the logic if it is not flawed. > I u...

Query locks
I have a query (see SQL below) that connects 2 tables: Contacts and Orgs. Each table has the field Organization in it. That field is the linking field between the two, and it is the primary key of the Orgs table. It is set up so that if the organization is not available in tContacts.Organization, the new organization can be typed in tOrgs.Organization. Most of the time it works great. But sometimes, it won't let me type in the field torgs.Organization. I don't get any "locked for editing" message ... I type and no letters appear in the field. The database has just...

linking two forms
I have two tables: Table 1 stores the primary key, Protocol#, along with details about the protocol. Table 2 stores additional information that will apply to SOME of hte protocols. It has no primary key, but is linked to table 1 through Protocol#. Problem: Form 1 is where I enter details into Table 1. I'd like to enter information into Table 2 using a separate form (not a subform), Form 2, which I can access from Form 1 using a button. I set the VBA code to open Form 2 as follows: Dim stDocName As String Dim stLinkCriteria As String stDocName = "FRM_2" st...

auto fill a form
please help I have tried but cant seem to get this to work. What I need is information from form 1 to be auto field in on form 2 I already have a combo box on form 2 that pulls data from a field (unit number) on form 1. Now I need the information for 4 more fields (vin mumber,make,model,year) on form 2 that is also on form 1. Thank you..... I may be reading too much into your description... It sounds like you want to replicate data. That is, you want data in one table (visible via form1) to be added to a second table (via form2). If this is what you are trying to accomplish, consider ...

Possible to detect changes to an XmlDocument object?
If I instantiate an XmlDocument object, the load a file through the Load method, is there a way, later on in execution, to easily determine if the XmlDocument object has changed from the original version loaded? I'd like to be able to check a condition to see if the document in memory has been editted (i.e., nodes added, attributes changed, etc.) so that my user can decide whether or not to commit changes to the disk file before moving to another file. Will I have to resort to re-loading the file, and comparing OuterXml properties? Gabe Gabe Covert wrote: > I'd like t...

Is it possible to compare a string and a field name
I have the following tables: Membership, Subscriptions, OfficeUseOnly. The Office Table contains a Year, Year To and From [financial year] and the other fields are the 5 membership types (regular, student etc) and these 5 fields contain the different amount each type of member has to pay. I want to create a form whereby on entering the financial year and the membership type the correct amount is automatically inserted into the 'Amount' field: FinancialYear - in current form = OfficeUseOnly SubsFinYear and then if MemberType = 'Student' find Student field ...

Minimise form. leave open in background etc.
Hi I have a user form which has been set up to be used as a menu with lots of buttons doing various operations. After clicking a button and carrying out the task(s) I would like to able to move back into a worksheet(s) do some work and then step back to the form. At present I have to close the form do the work and then reopen it. Is it possible to minimise the form, leave it open in the background whilst I work on the sheets and then maximise to choose/use further menu items etc.? Any help with coding would be gratefully received. Thanks Richi Richi, You can make the userform modeles...

want show result in spread sheet, in the form
Hi all, I have a form with a combo box , listed with 5 items. when each item is selected it will execute a query and result will in spread sheet window like how normally appears when a query is executed. but I want to add some thing like spread sheet, in the form at the bottom. when a query is executed the result should appear in the bottom attached spread sheet. pls help me here in 2 things. 1. where and what should i add at the bottom which seems like spread sheet and how to add it. 2. how to make possible the result will appear on it. thanks in advance.... ...

Update Sub form as user enters data in main form
I have a mainform that uses an unbound combo box to populate a subform. This works great. This will display all of the existing data for my contracts. If however they want to add more contracts, they enter the data on the main form and after continueing on to the next record and selecting that company from the combo box, they will see that their contract has been added to the list. I would like to be able to show the user the data they are entering into the main form is also going directly into the subform as a new record without the need of a command button or advancing a record. At one p...

pictures in various shapes
Is it possible to insert a picture and make it into a circle or an oval or various other shapes than just squares and rectangles? Thank you ahead of time. with a graphics editor -- Rob Giordano Microsoft MVP - FrontPage "Stephanie" <Stephanie@discussions.microsoft.com> wrote in message news:014D0D06-15F9-4D92-8D93-64FBD3A9CA32@microsoft.com... | Is it possible to insert a picture and make it into a circle or an oval or | various other shapes than just squares and rectangles? Thank you ahead of | time. | | Stephanie wrote: > Is it possible to insert a pict...

Can I assign an ip form within a program on Windows CE 6.0
Hi I know in Windows CE 6.0 you can change the ip address on the device by doing the following 1. Navigate to : Start -> Settings -> Control Panel -> Network and Dial up Connections 2. Right click on the network adapter and select Properties 3. You will see the IP Settings dialog box 4. Click Specify an IP address and fill it in I would like to do the same thing in a program. What do I wirte too? Are they registry entries or something in the smbserver.dll? Can someone please provide some detail on what to write too? -- Don Just ...

FRx Base Year Enhacement
The FRx Report Date field for the base year should be enhanced to allow the flexibility of hard coding the year in the same manner as the default base period can be hard coded and saved. Right now, in order for the base year in FRx to remain as 2005, we need to keep one of the 2005 fiscal periods opened in Great Plains. Our financial folks would like to keep all the 2005 fiscal periods 'closed' until they complete all the financial statements. We cannot do a year end close since some last minute journal entries are required to be entered in Great Plains for 2005. Thanks. Frank ...

Knowledge Base Articles 09-20-06
Can you add attachments to Knowledge Base Articles? Thanks, Boolean1 KB Articles are system entities that cannot be customized. Since they dont have a notes tab, I dont believe that you can attach a note. You might try exporting the sitemap.xml file and manually editing it to include a notes tab. I doubt that it would work but it may be worth a try. Editing the sitemap.xml is documented in the SDK. Good luck. -- Bullitt Fitzhugh MBS Certified Master- CRM 3.0 "Boolean1" wrote: > Can you add attachments to Knowledge Base Articles? > > Thanks, > > Boo...

How do I change default mail form?
Working in a MS Outlook 2000 Corporate or Workgroup Exchnage Server environment how do I change the default message form that's used for my email? I've created and saved a customised version of teh form, I just need to know how to point the New button at it. -- Regards. Chris. Remove MAPSON to reply to me directly. This post represents the views of the author and does not necessarily accurately represent the views of BT. ...

Is this possible
I want to make a list of the files in several different folders. Is it possible to somehow "Copy and paste" just the filenames into a list, in either Word or Excel or Wordperfect. I am just trying to sort the files in several different folders to weed out duplicates. There has got to be an easier way then typing them all or screen printing the lists and manually weeding them out. Any suggestions. Frustrated... Hans, Here is some code that will start in a directory and list all files in that and any sub directories. It uses recursion to go through all the subs. Just ch...

add maskedbox to form on runtime
Hello to you all is it possible to programmatically add a maskedbox to a form at runtime? thanks Catharinus "Catharinus" <csvanderwerf@planet.nl> wrote... > Hello to you all > > is it possible to programmatically add a maskedbox to a form at > runtime? Assuming the Masked Edit control library is referenced in the project, With Controls.Add("MSMask.MaskEdBox", "MaskEdBox1") .Move 100, 100, 1200, 350 .Mask = "(###)-###-####" .Visible = True .SetFocus End With On 21 a...