Can anyone see what's wrong with this code? It's a simple INSERT INTO statement yet I continue to get a "Syntax error in INSERT INTO statement". The Renewal table is the "many" of a one to many relationship but a similar record exists in the "one" table. If I open up the Renewal table I can...
As an absolute beginner with reports in VB6 I have a Data Environment pulling from an Access2007 database. I also have a date report that prints fine but I'm trying to place a caption into a label based upon the value of a text field in the detail section. My problem is I don't know when to do...
Using the following Update statement I get a "Compile Error: Expected: (" with the last appersand in the last line highlighted (the one directly after "strComp". I thought I've tried every variation with no luck. The string value strComp may contain hyphens. Can anybody see what I did wrong...
I'm trying to pull all records that include an anniversary date 6 months from the current month. For example it is now July so I want to list all records with an anniversary any day in the month in December of 2013. I tried the following code but does not consider the year. It returns records...
I'm trying to set the recordset for a form to show all leases that renewed the previous month. For example it is now January if I open the form I want the recordset to show all leases that renewed in December, next month, February, I want the forms recordset to list all leases that renewed in...
I want to return all records that have the RenewalDte falling in the 6th month from the month the sql is run. I've figured it as a query in Access 2007 but can't seem to get it to work as an sql statement. Hopelessly lost, any help is appreciated. The statement the won't work is below.
strSql...
I use the following subs in VB6 to open a connection and a recordset in an Access97 database. The problem is in the Open_Recordset sub when I end the sum the recordset closes. It opens fine correctly but I need it to stay open after ending the sub so I can work with it. Is this possible...
Here's an easy one I'm sure. I'm going cross-eyed looking at it. I use the following SQL to pull a record using 2 criteria. The recordset opens fine using everything except the "Answers.Race = 'White' portion. With the entire statement I get the Syntex Error (Missing Operator) error the portion...
Using the following code I have a questions. .Fields(intFldCntr) = 2.66666666666667 yet after loading it into arrWhite(intIndex), arrWhite(intIndex) = 3. I'm working to get some weighted averages so I want the actual number. How can I prevent it from being rounded when I load it into the array...
I'm trying to get the totals for Answer1 for each record with the size field being large. Using the line below I get the error "Expected End of Statement" and the word Large highlighted. I'm sure it's a simple change but I can't seem to figure it out. Thanks for any help.
strSQL = "SELECT...
I use the following code to print two reports
DoCmd.OpenReport "Preliminary", acViewNormal
DoEvents
DoCmd.OpenReport "Daily", acViewNormal
The issue is I have as my default printer a shareware to print to pdf format. When printing the reports the first works fine, the box comes up for me to...
I'm querying a field in a table that contains two letters, for example MF, SE, DT, and so on. I would like to order the query results so a specific pair is returned last every time the query is run. I guess the sort really doesn't matter I just want DT for example to be returned last in the...
Hi All, I want to delete a table in a back-end database and then move a table from a second database into the first to replace the one deleted. It's basically a simple swap. When a form opens up in the front-end database the code will delete the back-end table and move its replacement from the...
I'm using the code below to create an Access table. It works fine but the Primary keys, Field1 and Field2 are not indexed . If I only list one field as the primary key it is created as indexed with no duplicates. Can I create two primary fields and have them both indexed with not duplicates...
Can I use a an ADO recordset as the object type with acGoTo? I have a recordset based on a query open and want to go to a specific record within it.
Thanks,
Hi All, I'm trying to limit query results from a table to only records within which a specific field contains alpha characters and the field is 4 characters long. Though the field is a text field it may contain "A1" "AA1" "AAA1" and "AAAA". The last "AAAA" is the only record I would want to...
Hi All, I call the LoadRecord sub in the AfterUpdate event of a combobox. The code blows in the Set rs = line telling me Data Type mismatch in criteria expression. The data type is text throughout, even the field FileRef in tbl1 is text.
What am I missing? Thanks!
'Calls the LoadRecord in...
Using the function below called from a form I trying to change the backcolor of controls if not empty. The code runs without errors but does nothing to the backcolor. The controls are enabled. Thanks for the help.
Function Shade(strForm As Form)
For Each ctl In strForm.Controls
If...
Can anybody help me populate a combo box in VB6 with data from an Access database. The issue I'm struggling with is the combo box must have multiple columns. Each record in the database has two fields and both fields must appear when the combo box pull down is activated.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.