473,388 Members | 1,342 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.

hiding record with macro

i want to hide all empty records in a form of mine I found the following code but cant get it to work basically because i have to have a space inbetween the field name

The code i found is as follows:

Private Sub Form_Current()
If Not Me.NewRecord Then
If IsNull(Me!ContractDate) Then
Me!ContractDate.Visible = False
Me!LabelName.Visible = False
Else
Me!ContractDate.Visible = True
Me!LabelName.Visible = True
End If
Else
Me!ContractDate.Visible = True
Me!LabelName.Visible = True
End If
End Sub


My Field Name is "AFRICAN SUMAC" to replace "ContractDate"

It comes back as a List Separator and End Code Error message


Any help on how i can substitue for a space _ in the so i can use "AFRICAN SUMAC" in the macro without removing the space in the field name
Mar 4 '11 #1
1 1337
TheSmileyCoder
2,322 Expert Mod 2GB
Hi and welcome to BYTES
Access has a different naming convention for macros then Excel does. When you write code like that, its usually referred to as Visual Basic Code and not a macro.

If you want to use form names/control names where you have a space, you can use [] around the name:
Expand|Select|Wrap|Line Numbers
  1. Me![AFRICAN SUMAC].Visible = True 
I might add that I ALWAYS when making tables use underscores when creating field names (and table/query/form/report names) for example AFRICAN_SUMAC.
Mar 4 '11 #2

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

Similar topics

25
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...
3
by: Randy | last post by:
I have been able to set up a Find Record Button on my switchboard to take me to a form with the correct case number by using a parameter query and macro. When I try to run the Find Record button...
2
by: Keith Austin | last post by:
I need to produce a macro for a project that I have to do in my course in IT "Certificate III IT (Software Applications) Unit ICAITUO18C". The macro needs to validate previously imported data from...
2
by: Smriti Dev | last post by:
Hi There, In my access form, I do not want the record navigation button in the bottom to display. How can I hide it from the interface? Thanks, Smriti
4
by: Thomas Matthews | last post by:
Hi, I have several translation units (modules) which contain static {local} variables. These function have short global accessor functions. I would like to change these functions into macros,...
5
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In the function, I'll reading data from the record...
6
by: jcf378 | last post by:
hello-- i am having trouble figuring out how to export individual records from an Access 2002 Form into a pre-existing Excel spreadsheet, such that the exported record is merely appended to the...
0
by: andymcintosh85 | last post by:
Hi, I have designed a macro which prints out the first 2 pages of a word document. The Macro is assigned to a command button which is at the bottom of the second page. At the moment, the macro...
2
by: Stratocaster | last post by:
Hello, and thank you for any help in advance. I need help determining if any commands exist in VB (Excel macro style) that can enable a user to select cells and run a macro which performs...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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,...
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.