[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Changing a fields control source based on the type on input

Posted on 2013-06-06
3
Medium Priority
?
242 Views
Last Modified: 2013-06-06
Ok, so I have a SSN field.  Right now it displays correctly so that is not a problem.  But what I want the field to do is change it's control source based on whether a new record is being added our not.

Currently the control source displays like this:
="XXX-XX-"+Right([SSN],4)

This displays only the last four of a SSN

But when I add a record I want the control source to go blank, then on the after update I want the control source to display how it would normally.

Thanks
John
0
Comment
Question by:John Sheehy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 39226098
John,

 In the forms OnCurrent event, do:

 If Me.NewRecord = True then
   Me.<myControlName>.ControlSource = "[SSN]"
Else
   Me.<myControlName>.ControlSource = "XXX-XX-"+Right([SSN],4)
 End If

Jim.
0
 

Author Comment

by:John Sheehy
ID: 39226289
Jim,

That worked.  Thank you very much.

John

PS still have the coin coming.  We had an issue with getting coins. Should be here next wednesday.
0
 

Author Closing Comment

by:John Sheehy
ID: 39226292
Great solution.  Quick and direct to the point.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
New style of hardware planning for Microsoft Exchange server.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question