Just A Quick Question On Recordset Function
Sep 29, 2005
sorry if this question seems misguided or stupid, but i figured maybe someone here could point me in the right direction. its really simple and short, and i did try searching first.
i have a query that i'm running as a record set:
Set status = CurrentDb.OpenRecordset("Select description FROM tblProducts WHERE product=" & [Forms]![frmLookup]![Text5])
and the field "product" is defined as text in the database. the problem is, when i try to look anything up via this query, my program returns that it cant find the record, even if it certainly matches something in the product field. now i'm pretty sure the structure of the query i'm using is for integers, not strings. my question is, what is the correct way to look for a string?
View Replies
ADVERTISEMENT
Mar 17, 2005
Quick question.....I have a menu that links to 4 main forms displaying data from 4 different tables. I wanted to add the facility to quick search on the menu(i.e enter a record (the primary key) into a text box and click search. I would then want it to open the exising form at the relevant record or produce an error message stating no record present. I would have 4 quick searches on the main menu (one for each form)).
If anyone could help me on this i would greatly appreciate it, or if you could point me in the direction of an example it would also be great (although i have been looking and havent seen one i can get my head round)
Cheers,
Marky
View 2 Replies
View Related
Feb 2, 2006
Hi
i open a query as a recordset in VBA. i then need to use the split function to split up a few fields. how do i do this for the entire recordset.
for example:
MySplitVar = split(rst1("Field1"))
now i need
rst("Field2") = MySplitVar(0)
rst("Field3") = MySplitVar(1)
keep in mind i can't write to table. i need to somehow create a new recordset (maybe clone) and add columns to it. also, i don't know if this is relevant, but i will need to do this for up to 12 columns which means that i will have two per column; i.e. total columns=24
I see that nobody is posting an answer so i will add an explanation what i am doing.
i came up with a great idea. i need a crosstab that shows two values. so i created a a column that has both my columns in one column. value column shows the following:
myValue: = myFirstValue & " " & mySecondValue
and in the total i select First. so now i have a crosstab that shows two numbers with a space between them. now i have a report that will show this crosstab query. then i set each field's controlsource on the report to a particular field on the crosstab. my problem is that i first need to split it up and i am stuck there. i need to somehow add columns to the recordset.
thanks,
sam
View 8 Replies
View Related
Aug 17, 2015
managed to get some code up and running but when trying to enhance it I have hit a rut.
I have a function that is looking up a query called Optimisation - Auto Optimise with operational data in it. I only need 2 key fields; consolcode and volume. There are 106 records with different consolcodes each with different volume. e.g consolcode: Chittagong to Rotterdam201452 (Chittagong to Rotterdam by year "2014" by week "52") and volume 161 (cbm)
I then run a code that allocates the volume into specific sea freight containers and returns the values into a different output table.
The allocation code works fine but when I run the loop function for the recordset rsttradelane it runs for the correct amount of records (106) but always returns the first record of Chittagong to Rotterdam201452 and 161 cbm and not the other 105 consolcodes with the different cbm. Giving me an output table with Chittagong to Rotterdam201452 and 161 cbm repeated 105 times!!
Code:
Set rsttradelane = dbsEPIC.OpenRecordset("Optimisation - Auto Optimise")
consollane = rsttradelane!consolcode
ConsolVol = rsttradelane!Volume
Do Until rsttradelane.EOF
'Optimisation code' then
Code:
rsttradelane.MoveNext
Loop
rsttradelane.Close
How do I ensure that each consolcode and its associated cbm is recognised individually and flushed through the optimisation code?
View 3 Replies
View Related
Aug 14, 2015
Special situation: The SQL Server Linked Server across the country is linked to a Read Only Oracle DB. This data pull works perfectly and populates the Subform.
The problem is that Oracle can take 3 to 6 seconds to retrieve the single record depending on the network traffic through a small pipe.
The code below shows the RecordSource for the SubForm. clicking on a list box supplies the value. Then 3 to 6 seconds later, the subform populates.
The actual Recordset for this Recordsource is needed to conduct Validation on each field. Normally this would be on SQL Server, I might just create a Recordset Oject and run this SQL statement again in 1 milisecond. In this case, it will probably take an additional 3 to 6 seconds. Avoiding another lengthy round-trip to Oracle would be prefered.
Goal: How does one grab, clone, or other wise reference the existing recordset for the SubForm?
Note: Immediate Window - One single field can be returned quickly
There are 48 fields that need validation - is there a way to reference the entire recordset?
Immediate Window during Break Mode:
? me.fsubsrNavSHLBHL("NavSH_QQ")
NESE ' this is the correct value for the current recordsource
Set a breakpoint right after the line:
fsubsrNavSHLBHL.Form.RecordSource = "Select * from vsrNavigatorSHLBHL where Well_ID =" & txtNavWellID.Value
Immediate Window:
? me.fsubsrNavSHLBHL.Form.RecordSource
Select * from vsrNavigatorSHLBHL where Well_ID =91229
View 4 Replies
View Related
Apr 27, 2007
Hi guys, I'm a bit confused: I know that opening a bound form will bring down the whole recordset. But if I create a parametered query as the recordsource, will it still bring down the whole recordset first and only afterwards cut down to the records matching the parameters?
Example: I have a clients table with 5000 clients on a backend mdb, and my client lookup form in my frontend mdb. If I open the form looking for just client "Jim Jones" (via the parameter query), will Access bring down all 5000 clients from the backend to my frontend first, and only then seek out "Jim Jones" before discarding the rest of the recordset?
For if this is true then this whole Access business is rather unsuited for networks, even a small one. I hope you guys prove me wrong.
Premy
View 14 Replies
View Related
Jul 7, 2013
I want to write a email where there are 2 or 3 different ordernumbers for same email, i want to include the email in the mail part as single column table. how to do it? also can i use result of one recordset for other recordset?
View 1 Replies
View Related
Nov 4, 2006
hey guys quick one
when creating a table in SQL how do you set a variable to yes/no i tried the BIT command but didnt like that so is there any other way?
cheers guys
View 2 Replies
View Related
Oct 16, 2005
Hey guys, I'm just doing this database and have suddenly realised I dont know as much about MS Access as I thought!
Q.1 - I need to run a query that displays the top 5 records in a table, how would I go about doing this?
Q.2 - In my tables, I have of numerical data like the following...
http://img276.imageshack.us/img276/2695/11ch1.png
is it possible to make a Totals column which automatcily adds up the data in the Fraud, Competition, Loss of data, etc rows? (similar to MS Excel if possible)
View 6 Replies
View Related
Jun 20, 2006
HI
I am creating this bloody db and I have created a form and when I open it, it shows, record no one, what I want it to do is open blank ready for a new bit of info to be put in. I know this is an easy one but im sick of the sight of access this week
With thanks
View 5 Replies
View Related
Jan 17, 2007
Hello
Great website. Does anyone have any information on the leafs (http://a-cholesterol-diet.com/index.htm). I have been looking all over the place but no one seems to have any information or listings of any websites, any help would be greatly appreciated.
Thx
View 1 Replies
View Related
May 30, 2007
I have done a little database for someone so they can keep track of available dates for their apartments in Turkey. They want me to add it to their website so people can look for themselves. I know I should join a beginners web design forum, but can anyone tell me how i actually log into a website? I have the wesite address and the password. Thank you in advance Ben
View 5 Replies
View Related
Jun 5, 2007
Hi all,
I am just wondering why Modules have the name of bas at the start of the name. frmForm and rptReport makes sense but why bas for Modules ?
Thanks in advance,
Mitch.....:confused:
View 3 Replies
View Related
Oct 29, 2007
I just joined and wanted to say hi to everyone. Also, I noticed that the forum runs off my screen.
Anyone else notice that?
melanie
View 2 Replies
View Related
Jan 9, 2006
Hello,
one of tables requires me to store sickness details, the sickness codes are all unique, they do however start with at least one 0 for example code - 000003 Description Stress. When you enter a code access automatically trims of the 0's to leave a 3.
Is there a way to override this im unaware of?
View 14 Replies
View Related
Apr 2, 2007
i am using the following query to make a table. i was wondering if anyone knew a way to have the table be named from data entered into a text box in a different form. so when different people type in different names a new different table will be created. thanks
CREATE TABLE tbalename (First_Name TEXT(20), Last_Name TEXT(25), dob DATETIME, Constraint Employees_PK Primary Key (First_Name, Last_Name, dob));
View 2 Replies
View Related
May 4, 2006
Bit of a newbie so help appreciated.
The system I have developed lists jobs (as in jobs that staff members need to go and do) in different towns and cities. These jobs are set as active or inactive depending if completed.
I need to run a report that allows the user to find active jobs in a particular town. I have made a query and by setting the status field to a criteria of "active" this ensures that all results in the query are only active ones.
I cannot find a way to allow the person running the search to enter the name of the town that they want. This would then allow the query and then report to list all "active" jobs in a particular town.
I have a table containing all the towns so hope I can offer the user running the search a means to either type the name of the town into a box or even better (to reduce typo's) be able to choose the town from a combo box.
Once the town has been selected, the report will list all active jobs in that particular town.
Thanks
Can anyone
View 1 Replies
View Related
Jun 21, 2007
I'm writing a field where it shows a combination of many fields.
For example, when a user types in "abc" in field 1, "def" in field 2, "ghi" in field 3, I will have to combine the three fields into "abc/def/ghi" with slashes in between them. However I don't want to have any slashes at the front or at the back the field.
There are unlimited fields of "abc" "def" "ghi" "jkl" "mno" etc. Any idea how I can write the code? I'm thinking using if statements. Is there other ways I can do this?
Thanks!!
View 9 Replies
View Related
Feb 12, 2008
I know I should know the answer to this but if you are creating a query that includes individual fields as well as calculations based on some of those fields, do you select the source field or the query "field" when using the expression builder?
View 5 Replies
View Related
Apr 22, 2008
Hi,
I have a database showing car details, and need to show all records whose MOT is due within the next 30 days/one month (from today)
It might be similar to my first question.
Thanks in advance
Dan
View 4 Replies
View Related
Nov 24, 2004
My Mgrs. have asked me to set up a spreadsheet to keep up with inventory for a certain section of the business. And I figured that in the long run it would be easier to set up a database instead of a spreadsheet. We have specific customers with specific products to keep together; and I have figured out how to fullfill this .... my problem lies with the actual inventory.
The questions:
1) Can I keep an Available tally for all products?
2) To ship out and receive in cargo do I need to make 2 tables or just 1?
I have to keep up with the location of the goods in the warehouse and I'm not sure if I should include that with the product table or a seperate inventory table.
I am not sure if I will be using the database to create 'orders' or what we call bills of lading to ship out the cargo so I'm a little lost on how to keep up with the quantity of each product in the warehouse. There is no 'reorder quantity' or anything like that. I just have to keep up with how much of each product I have in the warehouse. Then I also have to be able to keep track of what is received into the warehouse and what is shipped out of the warehouse.
Does any of this make sense? I'm so confused myself that I'm not sure that I am able to explain what I need or what my questions are without confusing any one I'm speaking with.
View 4 Replies
View Related
Jun 15, 2005
Hello everyone, I am new to the forums. I need to learn Microsoft Access very quickly, but I do not understand a thing! I have a list of features of Access that I need to learn: what they are and how to execute them. Could anybody help me please?
The features include:
Field-type
Field-insert/delete
Query – create using criteria
Record – insert/delete
Sort-simple
Structure – file/table
Objects types
Form – columnar
Form – tabular
Form – header/title
Report – create
Report – query report
Filter
Thanks
View 3 Replies
View Related
Jun 12, 2006
Hey guys,
I'm having two small issues with my database. The first is, I can't get my drop-down to display content on the Form "frmSearch" under "Cast".
And the second, not really a problem, more of an inquiry... on the same form, is there a way to set a default value in the "released before..." and "released after..." of "(enter year - xxxx)" and have that value not interfere with the search feature if it is left as default?
Any help would be greatly appreciated. I'm very new to database creation and an eager to learn about these things. Thank you!
View 3 Replies
View Related
Apr 1, 2007
I'm importing a rather large CSV file that has many employees, repeated on several lines (one line per day) that contains performance information.
If I want to create a separate table that will contain basic information about each employee (for inclusion on reports), would that be accomplished with a relationship?
I can setup a query to pull up the information by employee name, but I of course receive more than one row since on the import an employee can be listed several times (multiple rows).
The two tables would not share any data, I just want a setup so when a report is generated and a specific employee appears, this information is generated with it. Thanks :)
View 3 Replies
View Related
Nov 29, 2004
But not easy for me, as its been years since ive done this kinda stuff. I got a field called 'CreditCard#' in a table called Customer. The data type of this field, i've set to 'Number' but how do i format it so it only allows the user to enter in a 16 digit number?
View 2 Replies
View Related
Jan 22, 2005
Hey all. I've got a field that I'd like to put a paragraph or so of text into and I'd like to just click on that field and have an arrow open up a box with all the text for easy viewing... (i hope this makes sense). Anyone know how to do this? (I'm sure it's easy if it is doable) thanks!
View 4 Replies
View Related