473,387 Members | 1,844 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,387 software developers and data experts.

Pop-up form to add comments

10
I’m sure that this has already been answered but I can’t seem to find the answer.

What I’m trying to do is when the user clicks on a button on the main form to add comments to a memo field, a pop-up form appears that allows them to add the comments, after they add comments on the pop-up form, the entry is time/date stamped and added to the memo field on the main form.
Any code would be appreciated.
Thanks.
Sep 18 '08 #1
3 6868
missinglinq
3,532 Expert 2GB
This hack doesn't use a popup form but rather a second textbox to enter the data into. This textbox is originally hidden, and when the command button (Add Data)is clicked, it appears. Data is entered, and when the command button (now named Input) is clicked again, a timestamp plus the entered data is added to the memo field.

Now, in this example, there are two memo fields, but only one is bound, since the other memo field is simply a temporary holding area. The memo field is also locked so that all data entry has to be done thru the temporary textbox.

InputMemoField is unbound, and in the Property Box its Visible Property is set originally set to to No. I place mine side by side with YourMemoField so the user can refer to what's currently in the YourMemoField section while entering new notes.

YourMemoField is bound to the underlying table/query, and its Locked Property is set to Yes.

Place a command button on the form. Name it cmdInputData and in the Properties Box set its Caption to Input.

Now use this code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdInputData_Click()        
  2. If cmdInputData.Caption = "Input" Then
  3.    InputMemoField.Visible = True
  4.    InputMemoField.SetFocus
  5.    cmdInputData.Caption = "Add Data"
  6. Else
  7.    cmdInputData.Caption = "Input"
  8.    If IsNull(Me.YourMemoField) Then
  9.       If Len(Me.InputMemoField) > 0 Then
  10.         Me.YourMemoField = Now() & "  " & Me.InputMemoField
  11.         Me.InputMemoField = ""
  12.         InputMemoField.Visible = False
  13.       Else
  14.         InputMemoField.Visible = False
  15.       End If
  16.     Else
  17.       If Len(Me.InputMemoField) > 0 Then
  18.        Me.YourMemoField = Me.YourMemoField & vbNewLine & Now() & "  " & Me.InputMemoField
  19.        Me.InputMemoField = ""
  20.        InputMemoField.Visible = False
  21.       Else
  22.        InputMemoField.Visible = False
  23.       End If
  24.  
  25.     End If
  26. End If
  27. End Sub
Welcome to Bytes

Linq ;0)>!
Sep 18 '08 #2
Shaft11
10
Thank you this is exactly what I was looking for.
Sep 18 '08 #3
I can't get the above to work... I would really value a step by step guide, if you don't mind.
Thanks, in advance.
Will
Oct 14 '10 #4

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

Similar topics

4
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure,...
4
by: Andre | last post by:
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST =...
1
by: spencer | last post by:
Hi, The code. def buildStackMajor(): for node in dirStackMinor: #print 's is the node...', node dirStackMajor.append(node) dirStackMinor.pop() print 'POP the stack...', len(dirStackMinor)...
6
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the...
2
by: John Hoge | last post by:
I would like to open an exit pop when a user leaves my site, but I don't want to the back button to trigger the pop if the user remains in my site. I'm using the onUnload attribute of the Body...
15
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: ...
25
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a...
7
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element...
4
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent...
20
by: merrittr | last post by:
I need some C advice I want to read in string commands from a user when the user enters a \n I want to push it on the stac. Then at some point , if the user enters the word print pop off and print...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...
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...

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.