473,388 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Unbound fields and queries

Dear all:

I would like your opinion on this: is VBA code used for linking unbound fields with queries (the so called recordsets???). In other words, is there a way to insert data in a form from a data source different than the form's own data source, without using list or combo boxes?

I'd like your answer only, not how should it be done. That is, for example, "yes, there is a way to insert that data in a form without listboxes, but VBA is mandatory" or "yes there is a way without using listboxes and even withou using VBA". It is only to know what I should I learn next.

Best regards
Oct 14 '08 #1
8 2093
Stewart Ross
2,545 Expert Mod 2GB
Limperger, you ask a question then bound it with 'don't tell me how it should be done'??? This is a public forum, and perhaps others who read this thread may wish to know how it should or could be done, even if you don't.

You have also not been particularly clear in explaining the background of your question, which makes it difficult to 'read the runes' over what you are really asking here.

In answer to your question, at least as far as I can tell what it is: VBA is not the only way to update data from unbound controls - Access queries in SQL can be used as well. However, the Access database engine has limitations which mean that in some circumstances references to controls on forms (bound or unbound) will cause queries to fail, in which case VBA solutions may be the only practicable ones.

-Stewart
Oct 14 '08 #2
Hello Stewart:

First and foremost, thank you for your response.

Let me explain myself: when I enter this forum, I feel very humble. My Access ' knowledge is similar to that which may be learnt using an "Access Bible" book, with no knowledge of VBA or SQL. In this forum, topics beyond my Access ' knowledge are dealt and I have the impression that I have posted topics that are far easier to deal with than the average knowledge discussed in here (and I apologize for that). Nevertheless, I have found very useful insights and I thank all of you for that.

This time, I just wanted to know if unbound fields in a form can be populated with data whose source is different from that of the form. I felt VBA should be used here (as you have pointed out) but I was not sure. I just wanted your thoughts on this because I feel my next step in my Access learning process is to, precisely, learn VBA. But what I didn't want was to make you waste your precious time explaining how to proceed with VBA code when I have no idea of it.

And last but not least, I would like to apologize myself for my bad explanations offered in here. Maybe it is due to my limited English skills (though I'm studying to improve them).

Best regards
Oct 14 '08 #3
Maybe if I paste here the SQL statement, it will help:

[PHP]SELECT [CALCULO IPI].[IPI CALCULAT]
FROM [CALCULO IPI]
WHERE ((([CALCULO IPI].HISTORIA)=[Forms]![Registro_frm]![HISTORIA])))[/PHP]

"Calculo IPI" is a query that makes a calculation which is displayed in the "IPI calculat" field. With the specified criteria, it only makes the calculation for the selected record in the "Registro_frm" form ([HISTORIA] serves as the primary key). When the form is open and a record is selected, then if the query is launched, only a result is displayed (the "IPI calculat" for the selected record). Then, I would like this result to be displayed in an unbound field in the form "Registro_frm", without using a combo/list box. Is it possible? Maybe using the DLookUp function? Or VBA?

Thank you very much in advance.

Best regards
Oct 15 '08 #4
Hello!

Could someone have a look on this?

Best regards!
Oct 16 '08 #5
NeoPa
32,556 Expert Mod 16PB
I was going to reply earlier, but I had a busy day yesterday and couldn't get on.

On that point, could I suggest that an appropriate interval to wait before bumping a thread should be 24 hours at least. We try to get things sorted faster than that, but there are so many reasons (principle of which is that all members are volunteers) why we cannot guarantee any timescales.

As far as your question is concerned, I'm a little confused as I thought you had made it clear that all you wanted was a simple indication of whether or not VBA coding would be requiired. As Stewart answered this clearly in his post I'm not sure where we're at and what you are looking for further.
Oct 16 '08 #6
NeoPa
32,556 Expert Mod 16PB
Maybe if I paste here the SQL statement, it will help:

[PHP]SELECT [CALCULO IPI].[IPI CALCULAT]
FROM [CALCULO IPI]
WHERE ((([CALCULO IPI].HISTORIA)=[Forms]![Registro_frm]![HISTORIA])))[/PHP]

"Calculo IPI" is a query that makes a calculation which is displayed in the "IPI calculat" field. With the specified criteria, it only makes the calculation for the selected record in the "Registro_frm" form ([HISTORIA] serves as the primary key). When the form is open and a record is selected, then if the query is launched, only a result is displayed (the "IPI calculat" for the selected record). Then, I would like this result to be displayed in an unbound field in the form "Registro_frm", without using a combo/list box. Is it possible? Maybe using the DLookUp function? Or VBA?

Thank you very much in advance.

Best regards
Maybe it will help if I simply treat this as a new question unrelated to your first post. Let's see what we can do.

In this case I would add some code into your Form_Current() event procedure similar to the following (assuming your unbound control is also called [IPI CALCULAT]) :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   Me.[IPI CALCULAT] = DLookup(Expr:="[IPI CALCULAT]", _
  3.                               Domain:="[CALCULO IPI]", _
  4.                               Criteria:="[HISTORIA]='" & Me.[HISTORIA] & "'")
  5. End Sub
If [HISTORIA] is numeric rather than string, then replace line #4 with :
Expand|Select|Wrap|Line Numbers
  1. Criteria:="[HISTORIA]=" & Me.[HISTORIA])
Good luck with this :)
Oct 16 '08 #7
Dear NeoPa:

Thank you for your response (as always).

Best regards
Oct 22 '08 #8
NeoPa
32,556 Expert Mod 16PB
I'm pleased I could help :)
Oct 22 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
11
by: deko | last post by:
I need to create different recordsets based on queries that use data from unbound fields in a form. I've discovered that I can't do this, and instead need to save the data in question (usually a...
4
by: Lumpierbritches | last post by:
Thank you once again for any and all assistance. I'm building an application that's getting quite bulky due to the number of forms, macros and procedures. I was wondering if there's a way to use 1...
3
by: Stig | last post by:
Hi, Any help on this one will be greatly appreciated as I have spent too long banging my head against the screen trying to get it sorted. Basically I would like to have a select all records...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
10
by: Matthew Wells | last post by:
Hello. I've converted a bound Access 2000 form which displays data retrieved from an Access 2000 database to an unbound form. Now my hyperlinks don't work. I'm assuming it's because the form...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
0
by: mirin | last post by:
Hello, In a Default.aspx page, I need to display an unbound grid with the following editable columns: Name, Location, Phone, Paid, Amount Initially the grid would be empty with only the...
7
by: HSXWillH | last post by:
I am designing an inventory system and am stuck on a potential problem. I have a table of Stock_Catalog containing the following fields: Stock_ID (random autonumber), Full_Desc, Serial, Auto,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.