With the following VBA code, I'm trying to select the text value from a textbox and fill that in a query to select the code from a person. (a password only login).
However, I'm getting a run time error 3078 at the '' Set rs = db.OpenRecordset("strSQL")'' line.
Code:
Private Sub Tekst6_AfterUpdate()
Dim strSQL As String
Dim strBarcode As String
Set db = CurrentDb()
'strBarcode = Me.Tekst6
'MsgBox strBarcode
I am exporting a report from access. The problem is after export to .rtf, all fields appears correct except a bar code field (CCode39). It adds a space after the text which makes text non-recognizable by bar code scanner.If I use other formats, then there is no problem. I tried by using plain text as well rich text format for that particular field.
i have got a query that returns the top 100 results. i would like to link this to my report form where i have a text box that you can enter a number and the query returns the first of that ammount rather than going into the query everytime to adjust the results.the sql of the query is as follows
PHP Code:
SELECT TOP 100 tblClientDetails.FirstName, tblClientDetails.Surname, Sum(tblOrdersItems.Cost) AS SumOfCostFROM (tblClientDetails INNER JOIN tblOrders ON tblClientDetails.ClientDetailsID = tblOrders.ClientDetailsID) INNER JOIN tblOrdersItems ON tblOrders.OrderID = tblOrdersItems.OrderIDWHERE (((tblOrders.OrderDate)>DateAdd('yyyy',-1,Date()))) GROUP BY tblClientDetails.FirstName, tblClientDetails.SurnameORDER BY Sum(tblOrdersItems.Cost) DESC;
I have a query that is returning inaccurate "Date Completed" results. Here is the SQL:
PARAMETERS [Enter Start Date] Text ( 255 ), [Enter End Date] Text ( 255 ); SELECT DISTINCT [Qry BDM FA English Email Test Part 1].ADI_DISTRIBUTOR_ADVISOR, ADL_AAH_ADVISOR_ACTIVITY_HISTORY.AAH_DATE_COMPLETE D, [Qry BDM FA English Email Test Part 1].AGA_EMAIL, ADL_AAH_ADVISOR_ACTIVITY_HISTORY.AAH_EMP_ID, DateAdd("d",180,Date()) AS [Next Update],
I have records using a select query that I am sending to a make table. I would like to have those records excluded from being used again for 180 days, at which point they can be used again. Essentially, I have an ID and an email address which gets stored in the Make Table. I would need to ensure that if we send an email out in Week 1, we do not send an email again for another 180 days if there is activity from that same ID. On day 181, the ID/email address can then be resent.
I am just starting with access and I have a VERY stupid question. I made a combobox (it gets its values from a table with 2 colums the first the ID and the second is the products) when a user selects one of the products in the combobox the combobox is supposed to update another table with that value (and I mean the product name) yet what it updates is the ID # of the product that was selected!! How do i go around this. I am new to access so i am not sure how things are done yet in access, i am pretty good in VBA in excel, but this is a new front for me that I am trying to learn. I did the above combobox using the wizard.
I have a subform generated by a query, I then have a double click function to run a further query this works when I open the subform separatly, but if I open the form and then double click on the field in the subform this will give me a error!
Hello I have another prob. I need to be able to take a new ID from the topics table and insert it into the messages table after a form has been posted. I haven't got a clue on how to do this.
Its for a message board where a new topic is inserted. Two tables need to have records inserted, the topics table and messages table. The Topic_ID from the topics table is an autonumber and needs to go into the TopicID field in the messages table. Here's my insert query:
Hello, Im using a ASP and MS Access 2000 database. What im trying to do is: I insert a row into a table, in that table is a field that auto increments. after I insert this row I want to immediately after that be able to retrieve the value of the column containing the auto increment and hold it in a variable so i can use it for other things....
can anyone help me with this? I have been messing around with SQl cursors but cant seem to get it to work right..
Thank you very much -Justin B. Edit/Delete Message
I have the following tables, tblAudit and tblCriteria. The first records companies and period of audit, the second contains the criteria against which they will be audited. The audit period determines which criteria apply. Results are recorded in a third table, tblAuditResults.
My problem is when I try to add a new result by selecting a criteria via a combo box a new row is inserted in the criteria table as well as in the result table. Inserting a row in the criteria table is wrong.
I have a question about a form which has several fields on it. What I need to do is to capture the ALL the fields of the record I just entered(updated or inserted)
So, for example, if my form has fields for
RepID, RepName, Company
After I edit or insert a new record, when I click to the next line, is there a way I can use AfterUpdate event to capture ALL the fields that were just updated on the form, and do whatever it is I need to do with them? I hope I am amking myself clear. Thanks for taking the time to look.
I am inserting a new record into a 'master' table. Primary key is generated using a sequence. Now using that newly inserted primary key value, I need to insert a new record in child table. These 2 insert queries need to run at the time of deployment. how shall I store that primary key in a variable so that I can use it immediately in next insert statement?Can I use a returning into clause?
I have a table of nursery school children, names, addresses etc etc. One field is Under 2? Is there a validation rule (or something like) that will automatically put Yes (or No) depending on today's date and the child's date of birth?
I have a text box on my table form with the expression =([LINES]-[MISSED LINES])/[LINES] which gives me the results I want but I also want this total to go to the "On time %" column in my table.
I have used Calendar controls before but this is a new one on me?! When i click on the Calendar, what i am doing is inserting the date clicked into a textbox on another form. The Calendar is set to todays date the system date is also correct and although i click on 31/05/06, what is being inserted is 31/05/20 ?????
I have a table that holds company information for the user - eg farm name, company name, manager, phone number and email address etc. Its simply used to provide headers for reports, so that the same generic database can be used on several farms. There is only one record in this table tblfarmdetails.The second table tblorder is for orders and receipts - I currently have code that allows the user to send an order request by email to the manager, and to also send notice of receipt of goods through to the manager. I would like the code to get the email address from the unrelated table.Can I reference this field in the vba?
Private Sub cmdemailorder_Click() Dim orderdate As String Dim stafford As String Dim item As String Dim itemamnt As String
i want to insert a calculated value of a e.g field6 (field4 * field5) in forms into the database table. by using expression builders in my forms. i have made that feild and on click it shows the calculated value but on filling in the rest of the form and clicking on Insert button does not update this calculated field but iserts all other fields.
I have elected to have tables inserted into my forms. For example on the School Information form, I have the Employees table inserted at the bottom so that it will show the employees that are assigned to that school when it's pulled up.
Before I split my database into a BE/FE situation, I could expand the items in the tables to other related items, but now that option is gone.
Is there any way to get that back with a split database?
If I write a select case statement for a field X i.e. 6 to 7 for example will this:1. Select any fields X where the number is greater than or equal to 6 but less than (and not including) 7B. Select any fields X where the number is greater than or equal to 6 but includes decimels of 7 i.e. 7.5 ORC. Select any fields X where the number is greater than or equal to 6 but includes but literally only includes cases where the the whole number 7 appears>I only ask because in an example in a book I am looking at says:Case 10000 to 20000......Case 20001 to 30000I would have through the word "to" means until but not including but in this case the field that equals 20000 would never be selected?
I am trying to run a sql statement in vba in which it selects all the records in a table related to a order Id number. I then want it loop through all the records and check for a check box which is selected. if its selected then "A" variable becomes "1" and i will then run a if statement saying if variable is 1 then run this code else run code b.
The problem I am having is that if there are 4 records the code checks through all of the 4 records and keeps changing the variable so
record 1 variable is 0 record 2 var is 0 " " " 1 " " " is 0
so although the records for a given order number does have a checked box the code wont recognise that.
What I can do or what code I can add my minds gone all blank on this.
i have aform which class module where i make 2 queries the first works fine but the other always return values with zero my select syntax is in clsschool and the query is