473,560 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Macro Actions, sequence & passing fields

114 New Member
Are the Action(s) in a Macro run in sequence? How would a OpenQuery pass it's results to a OpenForm that followed in the action list?

For example I have a form #1 that contains a couple of text boxes for a query and a Button with OnClick set to run a Macro. The Macro Action is OpenQuery with the Query Name set to an existing query. That query uses the parameters from the calling Form #1. This works when I look at the results in worksheet view.

What I want to do is add to the Action list a OpenForm as the next action. How would I pass the results of that 1st Query to the OpenForm that contails a combo or list box.
Dec 17 '06
81 9164
NeoPa
32,564 Recognized Expert Moderator MVP
To get the MetaData open the table in design view and all the information is there.
If it is a very large record layout then simply include the relevant fields - all those filtered on and shown.
Dec 18 '06 #11
NeoPa
32,564 Recognized Expert Moderator MVP
Can you try the following SQL code in your query (save/rename the other query first).
At this stage we are just trying to simplify things. The Nz() function returns the first parameter in the parentheses unless it has a value of Null, in which case it returns the second parameter.
Expand|Select|Wrap|Line Numbers
  1. SELECT last_name, first_name, med_rec_no
  2. FROM Translated_memo
  3. WHERE ((last_name Like Nz([Forms]![Trans_memo_lukup_Form].[WhatLastName],'*'))
  4.   AND (first_name Like Nz([Forms]![Trans_memo_lukup_Form].[WhatFirstName],'*'))
  5.   AND (med_rec_no Like Nz([Forms]![Trans_memo_lukup_Form].[WhatMedRecNo],'*')))
  6. ORDER BY last_name, first_name, med_rec_no;
Dec 18 '06 #12
ljungers
114 New Member
Morning,
I did copy/paste, the select worked OK and the results shown in Datasheet view show the filtered rows for columns from the Select (Trans_memo_luk up_Query: Select Query).

I now know what you meant by MetaData. How would a person either print or copy / paste that information?

The Datasheet that the query produces, is that not available for use in a form?
Dec 18 '06 #13
ljungers
114 New Member
Is there a (initupper) inital upper case that I could use for that WhatFirstName and WhatLastName. I realised just now that when I tried to run a test using my first name, no hits where found. But when I type Larry I get like 60 rows showing.
Dec 18 '06 #14
NeoPa
32,564 Recognized Expert Moderator MVP
Is there a (initupper) inital upper case that I could use for that WhatFirstName and WhatLastName. I realised just now that when I tried to run a test using my first name, no hits where found. But when I type Larry I get like 60 rows showing.
There is a function somewhere which I will dig up if required.
However, it is more usual to set both sides of the comparison to a set case (Upper=UCase() or Lower=LCase()).
NB It is important to set both sides - assumptions don't serve you well here.
Dec 18 '06 #15
NeoPa
32,564 Recognized Expert Moderator MVP
Morning,
I did copy/paste, the select worked OK and the results shown in Datasheet view show the filtered rows for columns from the Select (Trans_memo_luk up_Query: Select Query).

I now know what you meant by MetaData. How would a person either print or copy / paste that information?

The Datasheet that the query produces, is that not available for use in a form?
I'm afraid you'll have to type it out.
If there is too much there then simply include the relevant items. There is a way to produce this in VBA code but more complicated than it's worth to try to explain.
Dec 18 '06 #16
NeoPa
32,564 Recognized Expert Moderator MVP
Is there a (initupper) inital upper case that I could use for that WhatFirstName and WhatLastName. I realised just now that when I tried to run a test using my first name, no hits where found. But when I type Larry I get like 60 rows showing.
I wouldn't recommend usage of this for your requirements but the function you were asking about is StrConv().
StrConv Function


Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

The StrConv function syntax has these named arguments:

Part Description
string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system LocaleID. (The system LocaleID is the default.)The conversion argument settings are:

Constant Value Description
vbUpperCase 1 Converts the string to uppercase characters.
vbLowerCase 2 Converts the string to lowercase characters.
vbProperCase 3 Converts the first letter of every word in string to uppercase.
vbWide* 4* Converts narrow (single-byte) characters in string to wide (double-byte) characters.
vbNarrow* 8* Converts wide (double-byte) characters in string to narrow (single-byte) characters.
vbKatakana** 16** Converts Hiragana characters in string to Katakana characters.
vbHiragana** 32** Converts Katakana characters in string to Hiragana characters.
vbUnicode 64 Converts the string to Unicode using the default code page of the system. (Not available on the Macintosh.)
vbFromUnicode 128 Converts the string from Unicode to the default code page of the system. (Not available on the Macintosh.)
Dec 18 '06 #17
ljungers
114 New Member
There is a function somewhere which I will dig up if required.
However, it is more usual to set both sides of the comparison to a set case (Upper=UCase() or Lower=LCase()).
NB It is important to set both sides - assumptions don't serve you well here.
Thanks, I deffinately could use that, I know I will be asked to do that shortly after I get this working. Never ending ;-)
Dec 18 '06 #18
ljungers
114 New Member
I'm afraid you'll have to type it out.
If there is too much there then simply include the relevant items. There is a way to produce this in VBA code but more complicated than it's worth to try to explain.
here is the metadata that is in the table. Hope I provided enought.

Expand|Select|Wrap|Line Numbers
  1. Field Name --- Data Type -- Description
  2. rec_no - Number - Record Number Primary Key, generated prior to import
  3. seq_no - Number - sequence number of the transcription notes memo
  4. med_rec_no - text - Medical Record Number, can be blank if not assigned yet
  5. first_name - text - Patient First Name
  6. last_name - text - Patient Last Name
  7. full_name - text - Patient Full Name (First middle Last)
  8. trans_memo - memo - Transcription notes Memo data, notes from visit, used to print body of report
rec_no and seq_no have regular General for PK & index with lookup for both just "text"

med_rec_no in general tab show key index information (length & index information), the "Lookup" tab shows display control = Combo Box, Row Source Type = Table/Query, Bound Column = 1, Column Count = 1, Column Heads = No, List Rows = 8, List Width = Auto, Limit to List = No

first_name, last_name, full_name all just show the general as to length and key info, the 'Lookup" tab only shows text box for all three.

trans_memo general = No and "Lookup" tab is blank
Dec 18 '06 #19
ljungers
114 New Member
There is a function somewhere which I will dig up if required.
However, it is more usual to set both sides of the comparison to a set case (Upper=UCase() or Lower=LCase()).
NB It is important to set both sides - assumptions don't serve you well here.
Would I place the StrConv(WhatLas tName, 3) in "Event Tab" under properties and if so what event would that be?
Dec 18 '06 #20

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

Similar topics

25
3218
by: Andrew Dalke | last post by:
Here's a proposed Q&A for the FAQ based on a couple recent threads. Appropriate comments appreciated X.Y: Why doesn't Python have macros like in Lisp or Scheme? Before answering that, a clarification on what 'macro' means. A Lisp macro is a way of modifying code when that code is first defined. It can rearrange the structure of the...
1
11810
by: meganrobertson22 | last post by:
Hi Everyone- I am trying to use a simple macro to set the value of a combo box on a form, and I can't get it to work. I have a macro with 2 actions: OpenForm and SetValue. I can open my form, but I can't get the macro to set the value of a combo box on the form that opens. I don't need the macro to look up any values, I just want it to...
1
2286
by: ammarton | last post by:
Hello all...I'm a bit new to working with Macros in Access so forgive me if the terminology I use is not accurate. To preface this, basically I am using a form on a replicated database so the end-user can filter on a specific report they want to see. This database was designed by my predecessor (of which he left no documentation) and I...
13
1693
by: uma676 | last post by:
Hi all, I want to know the differebces between function and macro in c language. if anybody can tell me atleast 4 diff's. for which i will be regrated. Rgds, Balaji
44
3687
by: Simon Morgan | last post by:
Hi, Can somebody please help me grok the offsetof() macro? I've found an explanation on http://www.embedded.com/shared/printableArticle.jhtml?articleID=18312031 but I'm afraid it still doesn't make sense to me. The sticking point seems to be:
12
4749
by: Prabu Subroto | last post by:
Dear my friends... I am using postgres 7.4 and SuSE 9.1. I want to use auto_increment as on MySQL. I look up the documentation on www.postgres.com and I found "serial" . But I don't know how to create auto_increment. here is my try:
3
16201
by: swb76 | last post by:
Hi, I have 6 queries in Access that run great. They need to be run in sequence with the first 5 queries writing to tables and the sixth one pops up the final results in datasheet view. Now, how can i automate this process? I started with the simple macro builder and entered all 6 queries perfectly fine. However, i want to prompt the user if...
6
2292
by: jason | last post by:
Hi, I learned my lesson about passing pointers, but now I have a question about macros. Why does the function work and the MACRO which is doing the same thing on the surface, does not work in the following small example ? #include <stdio.h>
10
2262
by: gouqizi.lvcha | last post by:
Hi Friends, I saw a usage of macro like #define B3 "\xA\xB\xC" I don't understand why B3 is digital 10, can ayone point what the logic behind this usage. Rick
0
7636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7557
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7849
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7603
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7922
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1171
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.