Recent content by yn19832

  1. Y

    select unique record

    I am afraid I could not. Could you please give me some clue?
  2. Y

    select unique record

    I want to select unique country names from a recordset and now my code is strSELECT = "select distinct country" The problem is that ASIA and Asia are different, but it only selects one.How can I include both of them?
  3. Y

    Copy records with empty value

    I have designed a UserForm in Excel, the aim is to copy selected records from Access to Excel. The database in Access is like: Calendar Country Type Index ... ... ... ... The problem now is there are records with empty Index value, and when I select these records, an error message comes out...
  4. Y

    SQL- select record from Access

    I have noticed a problem. When I entered one country for one type, from 01/01/1980 to 05/01/1980, there should be four records, as the data are monthly data. But when I use Debug.Print intRecord It comes out 8 in the immediate window,that can explain why it copy the data for each country...
  5. Y

    SQL- select record from Access

    For the workbook, I leave the following two lines blank, they are supposed to be the paths for the database. Public Const cstrDB = "" Public Const cstrPath = ""
  6. Y

    SQL- select record from Access

    Thanks a lot for your help. I have been testing the codes the whole day, it turned out they are not as I expected. In fact, they are anything but I expected. I just could not figure out the problem as I go line by line. I really appreciate if you can give me a clue how you would do it, or help...
  7. Y

    SQL- select record from Access

    Thank you very much for your reply. First, could you please tell me how to set the cellformat of those cells that recieve the date field to something date-like. Secondly, based on your advice about the loop, I revised my codes for copying data to excel as following: Num =...
  8. Y

    SQL- select record from Access

    This part seems correct. But another problem came out, for example, when I add "Sentiment Canada" "Sentiment Chile" to the listbox, it just copy the sentiment chile's data twice to excel and the date is a mess as following: 29251.00 Chile Sentiment 33 29280.00 Chile Sentiment 26 29311.00 Chile...
  9. Y

    SQL- select record from Access

    Thank you very much for your reply and finally the immediate window shows "strSQL" as following: SELECT tblIndex.* FROM tblIndex WHERE tblIndex.Type = 'Sentiment' AND tblIndex.Country ='Canada 'AND tblIndex.Date > = #1/2/1980# AND tblIndex.Date <=#3/21/1980# My Short Date format has been set...
  10. Y

    SQL- select record from Access

    I tried debug.print strSQL, but the immediate window does not show anything.
  11. Y

    SQL- select record from Access

    I do not think the reason is because of the date, it is just the type error The date I entered into the UserForm is correct. It should be sth else, but I just could not figure it out.
  12. Y

    SQL- select record from Access

    I entered Country, Type, and Date and run it again, it turns out to be Syntax Error (missing operator) in query expression " tblIndex.Type = 'Policy' AND tblIndex.Country ='Canada 'AND tblIndex.Date > = # 3/01/1980 # AND tblIndex.Date <=# 21/01/1980#'
  13. Y

    SQL- select record from Access

    I entered country, type, date and run it again, and the error turns out to be" syntax error (missing operator) in query expression "WHERE tblIndex.Type = 'sentiment' AND tblIndex.Country = ' US ' AND tblIndex.Date > = # 01/31/1980 # AND tblIndex.Date <=#21/31/1980#" "(Error 3075)" , and it...
  14. Y

    SQL- select record from Access

    Thank you very much for your reply. It says error "The Microsoft Jet database engine does not recognize <name> as a valid field name or expression. (Error 3070)". Besides, I was wondering whether these codes just generate a recordset containing one record, instead of all the selected records as...
  15. Y

    Pull data from Access with SQL---Urgent

    I have designed an UserForm in Excel, the aim is to copy selected data from Access (tblIndex) to Excel. The UserForm contains a ListBox "ListCountry" and a ComboBox "ListType" to select country and type, and a ListBox named "ListCT" with two columns for selected country and type, and two TextBox...
Back
Top Bottom