Haha, I just figured it out, too. Widge removed the single quotation marks around the combobox reference. I guess single quotation marks aren't used with numbers.
My code had something similar, where I reference a textbox that users type a number into. I removed the single quotation marks, and the code worked like a charm!
Thanks again!...
User Profile
Collapse
-
I have no idea what this means. I have a similar problem, and this doesn't help me. Can someone explain what this solution means?
Thanks!
~mforema...Leave a comment:
-
-
I should also note that there will never be sheets that have the same name.
Thanks!...Leave a comment:
-
Searching Worksheets in Excel by Name
Hello,
I have a userform in Excel with a textbox and cmd button. I want to give the user the ability to search for a specific worksheet name within an Excel Workbook.
My code for the cmd button is as follows:
Code:Private Sub cmdSearchName_Click() Dim ChemName As String 'assigns user's entry to the variable "ChemName" ChemName = txtName.Value If ChemName =
-
LOL :) Sometimes I think better when I talk about problems with someone else; I guess it forces me to slow down and think through them more critically....Leave a comment:
-
Yep, that was it. The problem was the current value in the ArticleID textbox wasn't updated, which means the new Article ID didn't even exist in tblLiteratureAr ticles. So, I inserted the following code into the AfterUpdate event in order to save the new record:
Code:DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Thanks!
~mforema...Leave a comment:
-
I have tried the SQL in a query. I keep getting the same error message that says it will not append the table due to a problem with the keys. I think I may be running into problems with the AfterUpdate event. I want the code to get the current value from two text boxes - 1. txtKeyword1 from frmKeywords and 2. ArticleID from [frmLiteratureAr ticles - edit]. If the Article ID does not exist in tblLiteratureAr ticles, where it's part of the primary...Leave a comment:
-
I have three tables set up as follows:
tblLiteratureAr ticles
ArticleID (PK)
Title
Author
etc...
tblKeywords
Keyword (PK)
tblArticleKeywo rd (Join table with composite key)
ArticleID (FK)
Keyword (FK)
The primary keys in tblLiteratureAr ticles and tblKeywords are populated via VBA code, which works fine. My problem occurs when I try to populate...Leave a comment:
-
Appending Records to Table with Composite Key
Hi Everyone,
I am trying to write some VBA code that will append records to a table, but this table has a composite key. My initial code looks like this:
Code:Dim mySQL1 as String DoCmd.RunSQL "INSERT INTO tblKeywords (Keyword) Values ('" & txtKeyword1.Value & "')" mySQL1 = "INSERT INTO tblArticleKeyword (ArticleID, Keyword)" mySQL1 = mySQL + "
-
I believe I figured it out. The final solution is below; I will continue testing tomorrow to make sure that it indeed works.
Code:SELECT tblLiteratureArticles.Abbreviation, tblLiteratureArticles.ArticleID, tblLiteratureArticles.PrincipalAuthor, tblLiteratureArticles.TITLE, tblLiteratureArticles.Journal, tblLiteratureArticles.Volume, tblLiteratureArticles.Number, tblLiteratureArticles.PAGES, tblLiteratureArticles.DATE, tblLiteratureArticles.OtherAuthors,
Leave a comment:
-
Adding More Criteria to a Query
I have a query that uses a function to search for keywords separated by commas. The function works great! However, I need the query to also filter based on a yes/no field in a different table. My tables are set-up as follows:
tblLiteratureAr ticlesAbbreviation (FK)ArticleID (PK)TitleAuthoretc...tblLitCategorie sAbbreviation (PK - one-to-many relationship with tblLiteratureAr ticles)MajorCategorySelected (Yes/No field)... -
-
-
Problem with Function used in Query
Hi Everybody,
I have a function that worked perfectly when it was used in a query. I received help in creating this function from this discussion: Help with Query and Subform - post #18
However, I had to change the Data Type of one of my fields ("ArticleID" ) from a number to text. Now, the query doesn't work, and I know it's because of the change that I made. The original code and sql are as follows:... -
-
I feel like such an idiot...Yes, the code and the SQL work fine. I didn't paste the SQL exactly. Also, I've been trying to test the code with "distillati on, column", when "column" is not even a keyword - "columns" with an 's' is a keyword. Some of my other search forms use a code that searches for partial matches - like "dist" will bring up "distillati on" and "distillate ." I'm used to...Leave a comment:
-
It's not working. It's running into the same problems as before. It only works with one keyword. When it does show results, it shows multiple results, because tblArticleKeywo rd consists of the composite key where each ArticleID is joined with multiple keywords, like
ArticleID Keyword
Article 4 - distillation
Article 4 - column
Article 5 - reflux
Article 5 - distillation
Thanks for your help, ...Leave a comment:
-
Thanks! It works fine when searching for just one keyword, but nothing appears when searching for more than one. When I view the query in datasheet view, nothing appears at all, not even an empty row. However, I do feel like I'm much closer to solving this problem. I will keep working on it!
Thanks again for your help!...Leave a comment:
-
Leave a comment:
No activity results to display
Show More
Leave a comment: