Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Halet
  • Order by date
  1. Halet

    Error on hide form 1 and open form 2?

    I'm created startup form and there is a button there for me to click and hide it and then open my next form. I used the following code. It hided startup form and open the switchboard form but I'm not able to do anything to the switchboard form because the cursor remain positioned in the startup...
  2. Halet

    How to use form to change the table name in a query?

    I just click the query when I run them or using macros. It is not embedded in vba code. I tried copy the sql to word and do a find and replace, but that take too much time. Like I said, It is similar to what I do with date range. I type a date in the form's text box and I reference the text...
  3. Halet

    How to use form to change the table name in a query?

    I am currently using form to update date ranges in my database. Here is the sample of the query. SELECT FAR.[SVC DATE], FAR.[ACCT BAL]FROM FAR WHERE (((FAR.[SVC DATE]) Between Forms!frmUpdateDateRange!txtday0 And Forms!frmUpdateDateRange!txtday30)); I tried to use the similar code to change...
  4. Halet

    Microsoft access - Automate date changes in a query.

    I got it to work now. Thanks again! I set it up now that the form is going to do the calculation. User manually enter a date and press enter. All the date ranges are calculated and displayed in the text boxes. The queries are now link to each textbox. I didn't use the module at all because there...
  5. Halet

    Microsoft access - Automate date changes in a query.

    Thanks for the advice Lespaul! If I understand you correctly, I don't need to use a module at all. All I need is make the changes in all the queries to reference to the forms. Right?
  6. Halet

    Microsoft access - Automate date changes in a query.

    I understand the module will get the date from the txtbox. I'm looking one month down the road. I don't want to go back into the module and change the date and then run the module again. Instead of the code below,can I change #5/1/2007# to a variable named DayX in all queries, so that I don't...
  7. Halet

    Microsoft access - Automate date changes in a query.

    Thanks for the reply! Is there anyway I can exclude the hardcode in the module? based on your code, after the module is ran, the date will no longer be 5/1/2007 and 5/31/2007. Next month I need to come back in and change the date in here again. I understand it already shorten my manual task...
  8. Halet

    Microsoft access - Automate date changes in a query.

    I created a module. Based on the info here, Lespaul, can you tell me if i'm doing it right? _________________________________________________________ Option Compare Database Dim qry0 As Variant 'current date' Dim qry30 As Variant 'current date - 30 days' For Each qry0 In CurrentDb.QueryDefs...
  9. Halet

    Microsoft access - Automate date changes in a query.

    Yes, there are a lot of hardcode in the db. Currently, these queries are not attach to any form or button. I just display them in query grid and then copy them to a spreadsheet where the reports are. (used what was created by last guy on the job) I would like to automate it, so that it will...
  10. Halet

    Microsoft access - Automate date changes in a query.

    Where do you define the following code? in a module? in every query? Thanks again for all the wonderful advice. dim qry as variant for each qry in currentdb.querydefs
  11. Halet

    Microsoft access - Automate date changes in a query.

    Here is the sql. Thanks again for all the help! SELECT MAR.ID, MAR.NAME, MAR.[DOS] FROM MAR WHERE (((MAR.[DOS]) Between #5/1/2007# And #5/31/2007#)); DOS = date of service
  12. Halet

    Microsoft access - Automate date changes in a query.

    Thanks for the reply! In your example, qry is the name of the query? I included a set of date below. Can you give me an example using them? Days Prior to Month End 30 5/31/2007 31 5/30/2007 60 5/1/2007 61 4/30/2007 90 4/1/2007 91 3/31/2007
  13. Halet

    Microsoft access - Automate date changes in a query.

    I'm creating a report that use various date ranges. Currently, I have to manually update these ranges one by one by going to design mode and change the date. My idea was to have a form and link those date ranges to the form so that it will update itself. Update the form and all the ranges in...

Part and Inventory Search

Back
Top