Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Input Box - How Do I Store Values?


Hi. I'm a novice!

I have Excel spreadsheet - got an input box that says, put in this value. Then, I want the value to get saved to the cell in question (which for now I've hardcoded because I don't know how to make it select whatever cell is initially selected). I've tried using toString method, but doesn't seem to work.

How do I pass the value inputted into the input box to the cell? Code as below:


Code:
Sub Set_Status()

On Error GoTo HandleError
Dim status
Dim veld

status = InputBox("Please enter the status for this item", "Item Status")
Sheet1.Range("a3").Value = status.toString

MsgBox "Status has been updated"
HandleError:
ThisWorkbook.SaveAs

End Sub

If anyone can help, I'd really appreciate it!

Thanks in advance.

q_jd.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
User Input And Store
How would i allow the user to input a piece of text into a field and then click on a button so it is stored and then displayed on the screen?

Where To Store Input Data....
Hi,

I'm writing a very simple VB6 application but have a problem with the following. I want the user to enter a few text strings in textboxes. These inputs I would like to store so that when the application is re-opened, the data is available. What would be the best method to achieve this. Do I already need a database for this or can it be done in a simple way?

Thanks
hajunk

How Do I Store Data Thats In A Input Box Then Have It After Its Cleared...
Hey,
Im not too great at VB at the mo, but im making a calculator. All i need to know is how do i make it so if they input a number into txtinput.text, i need to be able to store that in some variable form, so i can call the number they put into the inputbox after its been cleared (the general format is they will enter a number, press the plus button, the txtinput.text will clear, then they enter the next sum to plus, and i then need to store that, and so on...)

Thanks for any help,

Ross

Where To Store Values In VB
Hi all,

I'm fairly new at VB and I always been wondering about this.

Say you have a small form where the user enters a value that
you want to keep track between instances of the VB application,
where do you put it?

Right now I created some sort of .txt file where I store the info, but
is there a way without creating a separate file?

What if I have my code inputting a new Public Const in the module?
Is that a good way to do it?

TIA

Possible To Store Listboxes Values?
Hi there,

I need to display a listbox with some values in it but the actual value that I want to pass to another program is different. How do I do it? Does VB have got something similar like the html listboxes?

<option value=1>banana</option>
<option value=2>coconut</option>
<option value=3>orange</option>

Thanks and regards,
Brendon

Get Values From A Store Procedure
I have the following code:

sSQL = "select count(*) as total from tmp where cod_rota=1 and sessao=" & Chave
rsESec.Open sSQL, cnEris, adOpenStatic, adLockReadOnly

If rsESec!total < 2 Then
rsESec.Close
cnEris.Execute "DELETE FROM TMP WHERE SESSAO = " & Chave
Else
rsESec.Close
sSQL = "exec sp_roptica_troncal " & Chave
cnEris.Execute (sSQL)
end if

The store procedure sp_rotina_troncal, retuns 3 values. If I use the code:
Set rsESec = cnEris.Execute(sSQL),
instead
cnEris.Execute (sSQL)

the application says that the recordset is close.

Does somebody know what can be? I had try use this code too:
rsESec.Open sSQL, cnEris, adOpenStatic, adLockReadOnly
but the problem persist.

File Dialog To Store Filename From User Input
hello.

apologies if this has been asked before.
Background info:I have converted an access 97 database to MS access XP.

As an additional area the software no manages a mailmerge of data by allowing the user to select a dataset and opening a mailmerge word document.

My predeccessor created a static list of the available word documents. as new ones are developed i have been tasked with developing a form so that the users can add the new forms to the list of available forms.

The problem
Rather than have the user type the string, such as "c:windowsfolderfilename", I want to use a file dialogue window they are familiar with from word etc for them to browse to the object. when they select it i want to store the value in the bound text box.

i have create the little |...| button but cannot figure out what code to put in its on click event. can any body point me to the correct code.

I have looked up "FileDialog" in the vba help but when i try to use the example below i get a "user defined type not defined" from the Dim statement


Code:
Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = false
.Show
End With

Am i along the correct lines? if so how do i get the chosen file back into my string variable to write to the txtbox?

is there a better way.

many thanks for reading.

Store Values Of Array To File
How would I go about storing the values of an Array for re-use

I have an array as so:

Dim myArray(100, 1000) As Integer

The first element will have values of 0 to 100,
and the second element will have values of either 0 or 1

Each program run could produce any number of arrays, so I would like to be
able to retrieve any one of the different output files as necessary.

ie DataSet01, DataSet02, etc.

Any ideas?

Get The Return Values - Store Procedure
Hi, I meet a problem when I am using the store procedure in SQL server 7.
If I want to passing the table name, and data into a sp. and let the sp to check whether the data oledi exist in the table or not. If it is exist, I want to return the data created Date, a fields in the table. If not exist, it will insert the data into the table. I meet the problem in return the data created date, because the table name is a parameter value. I only can use EXECUTE(strSql) to run the select statement but unable to read the value into a variable. Do you have any solution to solve this problem?

How Do You Store Array Values In A Table?
We had a tool that previously exported data from a Lotus Notes database to a text file. Once the file was exported, I imported it to an access table (Survey) in order to do calculations using a VB Module. The new tool that we have is a DB2 database and instead of being able to export data to a text file, I have to grab the data directly from the tables. I have created a query to pull the data and then load the data into a multi-dimensional array. I use the array to do my calculations as before using the VB module. Is there a way to read the data from the array and store it back to the access table (Survey) that I spoke about above? The elements in the array are in the same position and format as the fields in the table. I need to be able to do reporting for auditing purposes and combine the information from the old tool and the new tool. Is this possible?

How To Store The Values Into Array While Looping
i need to store the value into array while loop is executing.this is my code.there iere will be no of values node list . i need to store the BYTES,NUMBERS and CONTENT into 3 different arrays namely bytesval,numbers and content while looping .pls help me to solve the problem
Code:
Private Sub Command1_Click()
Dim objDoc As MSXML2.DOMDocument
Dim objNodeList As IXMLDOMNodeList
Dim objNode As IXMLDOMNode
Dim bytesval() As Long
Dim numbers() As Integer
Dim content() As String
Set objDoc = New MSXML2.DOMDocument
objDoc.async = False
objDoc.Load "c:
zb3.nzb"

'Return all the segment elements
Set objNodeList = objDoc.selectNodes("//segment")
MsgBox objNodeList.length
ReDim bytesval(1 To objNodeList.length)
ReDim numbers(1 To objNodeList.length)
ReDim content(1 To objNodeList.length)
For Each objNode In objNodeList
bytesval() = objNode.Attributes.getNamedItem("bytes").Text
numbers() = objNode.Attributes.getNamedItem("number").Text
content() = objNode.Text
Next objNode

Set objNode = Nothing
Set objNodeList = Nothing
Set objDoc = Nothing

End Sub

How To Store Values From Table Into An Array
i want to store values that i am extracting through the sql query from my table....any help on that .....how to code it should i use single dimension array or 2D array........

Multiple Listbox Values. How To Store Them?
Hello Again....I appologize for reposting this message again...didn't post it in the correct place at first. Sorry about that.
Can anyone help me with this access problem that I am having ?
Here is a brief description of what I would like:


I have 3 tables.
1- tbl-customer contains(customer-id, customer-name)
2- tbl-serials contains(serial-id, serial-description)
3- tbl-customerSerial contains(Customer-id,serial-id)

I have created a form that contains the customer info, and
I would like to add a listbox that outputs all the
available (predefined values) serial descriptions for that
particular customer. now, a customer can have multiple
serial numbers. I would like to store the values chosen in
the listbox in the tbl-customerSerial table.

I have searched online for references about this but
unfortunatly couldn't find anything .

Does anyone know how is this possible?
I appreciate all the help.
Thank you in advance.

How To Let Users Input User/pass && Store Inside A File?
as above...

so after storing into a file..next time they run it..they can login with the user/pass they registered with..i not able to run any db server..any other alternatives?

and is it able to share the db acorss more than 1 form?

Need To Store Different Sets Of Values Into Like A Video Frame
Hello,

I need to store values maybe an array of values into something like a video frame to control rgb led's. Is there a way i can program this with VB6. Once the values are entered for that frame i can do the next frame and so on. Once all the frames are setup with different values and patterns i can run the frames for led effects.

Any help is Appreciated!
Kevin

How To Read And Store The Values Of IIS Log File In SQL Server?
Friends,

We have an IIS Log file. The file size of the Log file will be 2GB and above.
Now what i want to do is.
1. I have to read the IIS log file using SQL server either by query or by procedure.
2. Then i have to store the data inside the log file in the sql server table.
3. Using the SQL server table i will generate the report thru crystal reports.

Can anyone tell me how can i read and write the IIS log file using the sql server?
By the way...Is it possible to read and store the 2GB and above log files ?


Thanks and Regards,
SathyGuy

MsAccess Multiple Listbox Values, How To Store Them ? Help!!!
Hi.
I have 3 tables.
1- tbl-customer contains(customer-id, customer-name)
2- tbl-serials contains(serial-id, serial-description)
3- tbl-customerSerial contains(Customer-id,serial-id)

I have created a form that contains the customer info, and
I would like to add a listbox that outputs all the
available (predefined values) serial descriptions for that
particular customer. now, a customer can have multiple
serial numbers. I would like to store the values chosen in
the listbox in the tbl-customerSerial table.

I have searched online for references about this but
unfortunatly couldn't find anything .

Does anyone know how is this possible?
I appreciate all the help.
Thank you in advance.

How To Read And Store The Values Of IIS Log File In SQL Server?
Friends,

We have an IIS Log file. The file size of the Log file will be 2GB and above.
Now what i want to do is.
1. I have to read the IIS log file using SQL server either by query or by procedure.
2. Then i have to store the data inside the log file in the sql server table.
3. Using the SQL server table i will generate the report thru crystal reports.

Can anyone tell me how can i read and write the IIS log file using the sql server?
By the way...Is it possible to read and store the 2GB and above log files ?

Its very urgent......

Thanks and Regards,
SathyGuy

How To Store Values To An Array Depending No. Of Files In A Folder??
hi, all. i am doing a program on changing file extension, currently i have created a function on changing file extensions. I would also like to create a function on reverting the new files extension back to the previous one.
So i thought of using an array to store the values of each filename, how shld i do that ?

for example if i had 5 files in a folder, i will have

array(1)=filename1
array(2)=filename2
array(3)=filename3
array(4)=filename4
array(5)=filename5

so that i can revert back to the original file ext. by retrieving values from the array.

my prob is:

for each file in xfolder.files

<how shld the array be constructed so that each filename can be stored in each index of the array?>

next

How To Read An Ascii File And Store Values In Memory?
Hello Gang,

I have this .asc file and the first 6 lines are headers the remaining file looks something like this:
0.5374 0.5918 0.7215 0.8622 0.9652..
0.5577 0.618 0.7739 0.878 0.9479..
.
.
.
.
.
The number of rows and colums of data depends on the size of file the user selects.. So Now i need to read each of the values separately as there is going to be an algorithm used where this ascii file will be the input and after some calculations, it'l give an output ascii file that is have the same set of rows and columns but difference in values due to the effect of the algorithm.
And this ascii file is actually a satelite image that can be used later for analysis..

So how I should go about it.. Do i use an array to write each of the numbers into it??


Ricky

How To Run A Select Query In VBA (Access) And Store Values In A Variable
hello

i want to run a select query in VBA (Access) and want to store values in a variable like

str = "select CountryCode from Country where CountryName = '" & Combo22.Text & "';"


here combo22.text is the name of combo bo from where the value for where clause will b selected . now after getting this value i want to store it in a variable and then want to use it in insert query.

like

DoCmd.RunSQL "Insert into table (val1,val2) values(txtval.Text,str);"

can anybody tell me how to do it in VBA
how to execute a query in access in VBA code

and second question is that how after execution of a query we can use that reults to poulate in a combo .


waiting for an early reply
regards
Naheed

Input Hex Values Only ?
How do I disable spacebar,delete and allow only hex values.

so 0 - 9 and A -F

Tried to experiment with just A - F first but having problems typing over bytes.

Example if I type any letter above F say on the third byte then my first byte are deleted. ?

I would like to carry on from the third byte without deleting the first or any other byte before if you get what I mean.

Also when I typed over my last byte I would like to automatically go back to the first byte.

'(1 textbox and 1 command button)

'8 byte example

Dim a As String
Private Sub Command1_Click()
a = "2B41D40C"
Text1.Text = a
Text1.Text = Format(Text1.Text, "&& && && &&")
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii < 65 Or KeyAscii > 70 Then KeyAscii = 0


If Mid$(Text1.Text, Text1.SelStart + 1, 1) = " " Then
Text1.SelStart = Text1.SelStart + 1

End If
Text1.SelLength = 1
Text1.SelText = ""
End Sub

Values For An Input Box
Hi guys,
how can I set an input box to accept only numbers (integer & double), not other characters. For example, '25' and '25.25' is valid but 'abc' will popup an error msgbox.

Also is it possible for the input box to accept both the '.' and the ',' as a separator? Because I've noticed that if I put 25.25 the calculation works fine, but with 25,25 I get a wrong number.

Thx.
Samantha!

Debugging Input Values
I think I am confucing the issue... I need to know if the length of a string is odd or even... without having to create a counting loop...

any simple functions hanging around in VB that can help?

How To Input Only Numeric Values Into A Text Box?
Hi guys..

I'd like to know how do I allow users to input only numeric values into a text box??

Thanks!!

Regards
Vivien

Subtracting Values In DB Using User Input?
I have an application (in ASP but I'm using vbscript) to get user input from a text field. This text field is for the user to enter an amount, eg. 100.

I named my database db1.

First, I need to check whether the amount that the user inputs is less than or equal to the amount in db1 (I named this field 'amount').

If the amount is less than or equal to the amount in db1, I will subtract this amount from the database. For example, under the 'amount' field in the db, I have 1000. Upon the user clicking on a button, I will subtract the amount that the user enters, from the amount in the db (For example, User enters 100. Therefore it will be 1000 - 100 = 900. If the user enters 300, therefore it will be 1000 - 300 = 700).


How do I do this? I only need to know how to subtract the values. Please help asap.

Input Statement Getting Values Wrong?
Hi,
I am creating custom mail recipients in Exchange 5.5 and have creating unique directory names by doing the following.

The date + an record number + the time

The string is written to a CSV file as follows:

1005200236115:29:21

But when I do an Input #1 field1,field2,etc

field1 returns 1005200236115 and ignores everything after this. Basically the colon is causing a problem.

Sadly, I have only just noticed that these entries are causing problems when Distribution Lists are created. My program searches for email address uniquness and uses a comparison of directory entries when populating a D/L.

The issue is that although the VB write command creates the correct file entry the input command truncates the entry when it is being read from the file. These entries are being read into an array.

Is there a way around this?

Regards,
Sam.

Limiting User Input Between Values
Hi all. I need to limit user input to between numerical values. For example, input numbers between (say) 10 and 100 are valid, but less than 10, and greater than 100 are not valid. Message box displayed for invalid numbers, and user is returned to cleared entry text box for another go at entering correct values. Any ideas how this can be done?

Putting Values To An Array From Comm.input
hi, im very new to this field
i have to put values you get from the following code to an array,

If MSComm1.CommEvent = comEvReceive Then
Label1.Caption = MSComm1.Input

and display them in a proper order
the values u get here are cardHolderName,InvoiceNo,BatchNo,....etc

with the code i have these values get displayed on a label.
but there's no order.

Validating Form Input Data As Values
Hi.

I have a form in excel with a text box. When a value is entered into the text box the following code is run

Private Sub txtBoxAddlFacOpt_Change()

' places the typed value into the spreadsheet
Range("addl_options").Value = txtBoxAddlFacOpt.Value

End Sub

I need a routine to check that the data input is within a range of values and indeed, is a value rather than a text string. If the input is not acceptable, I need an error box to pop up directing the user to do as required.

I have tried VBA help which gave the following code

With Range("addl_options").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="0", Formula2:="10000"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from zero to 5,000"
.ErrorMessage = "You must enter a number from zero to 5,000"
End With

but this just bombs out with an error at the .add statement.

Has anybody any suggestions? This is driving me crazy!

Thanks, Nigel

Real-time Microphone Input Values...
I need a way to obtain real-time values directly from my audio card (does not have meter "VU METER" support) via any input channel (microphone, stereo mixer, etc.) I know you can capture audio to a buffer using mciSendString, and then save it to a file; however, can you pull real-time values from this buffer and have it display in a text box? I COULD always have it write to a file, obtain the data, flush the file & buffer, and repeat... but I can't see constantly writing to the HD and doing all that JUST for a dang input value!

I know the mciSendString has a "paste" command; however, I don't think it's for what I'm trying to accomplish!

Can somebody help me out, or point me in the right direction! I can't believe VB6 is SO complicated when it comes to pulling information from the audio card. I remember being able to do this fairly easily using ASIC (and old QBASIC-type clone) and my old SoundBlaster 2.0 audio card!

Thanks...

Respectfully,

Eric D. Brown

How To Save Values / Text From User Input ?
I'm creating a game where players have to enter their names at the start, i want to take these names and hardcode them into the main code, can i do this. I don't really want to save to a txt file then refer back to that when need be ?

Saving Users Input Values To A New Recordset.?
hi how do i simply open record set then save all the values the user has put in?

like for example

make rs.tblalltowns.town = town.text

??

never done this yet heh

thanks again

Search File And Input Values Into Array
Ok, I used to code in VB6 a good while ago, then stopped for a long time, so I'm trying to blow off some dust here.

I need a section of code that will take text from a file or text box (richtextbox or textbox) and strip it down and add it to combo box. I can handle the combo box part, of course, but I'm not sure how to go about stripping it down.

Here's an example of what I need. I have a file/textbox that has the following contents:

Initializing...
More text here...
id=mr1337&amp;obj_buy_info=1&amp;obj_buy_cost=9000
id=maddsci2k&amp;obj_buy_info=5&amp;obj_buy_cost=9500
id=Tj42&amp;obj_buy_info=20&amp;obj_buy_cost=10000
Ending text

I would need to put in an array (or combobox) mr1337, maddsci2k, Tj42 and then another array (or combobox) 1, 5, 20, and another combo box 9000, 9500, 10000.

Thanks in advance, everyone.

How To Limit The Input In TextFields Only For Numeric Values?
Hi,

is there any way to limit the input in a Textfield that the User can use only 0...9 and ., or have I to write a Sub for the pressed Keys?

nice greetings
Franky

Access HTML Form Input Values
Hi,

I am using the webbrowser control to display an Html page in my application.

This page has a form where the user enters there information such as name, address ect.

How can I read the values of these elements in visual basic
For example msgbox webbrowser1.document.form.element(0).value

What References (eg HTML Object Libraary) do I need and how & what objects must I declare.

Thanks for your assistance
Jeff

Textbox For Only Numerical Input Including -ve Values
I am trying to filter the input to a textbox such that:

1. Only numerical values will be accepted.
2. A decimal point will only be allowed once.
3. Negative values will be allowed but only with
the -ve sign at the beginning of the input and
only being accepted once.

I have tried the DataFormat property and this does not seem to work. I seem to be able to trap the text values and decimal point constraints but the -ve has escaped me so far...

Any suggestions???

I am quite new to VB and may have missed something fundamental. Perhaps there is an API Function angle to this one with which I am not familiar...

Thanks

Creating Database By Taking Input Field Values From User
my query is regarding

i want to create database by using front end VB6.0 n
in this application user should enter input for the field of the database table where,
 there is already one data.mdb file which is used to create DSN named as data.

plz help me out on this problem
regards frnd vani..

Strange Input Behaviour File Input Output, Not Reading All Characters
Hi folks,

I have this file which consists of a few lines:

example:
Hello, how are you?

but when I use:

Input #1, line

the line variable only holds to the komma. So only "Hello".
I want it to read the whole line, how can I do this?

Solved: Line iput did the trick

Input Function (start Reading Input From Inside A Line)
How can I start reading input from the middle of a line?

strText2 = Input(LOF(2), 2)

This puts the entire contents of the file into the string strText2. Is there a way to put upper and lower bounds on the input function so itI can start reading input say at the 10th character to the end of the file?

something maybe like

strText2 = Input(10 to LOF(2), 2) ?

Ive searched around for quite awhile for the answer, and it seems odd that VB would not be able to do this (even though if it cant, im sure theres a good reason for it)

Thanks for any help

How To Input .CSV Database File Into VB, By Only Input The Selected Area
hi, i am a very beginner of VB, and having so much trouble, i have few question plz give me a help, or give me some example...
the case i am doing is to into the database file .csv into VB
1) how do i input my .csv file As file__name
2) if i need to compare the number from my csv file, such as, matching my input to the database file .csv in some Specaific area, do i need to input whole .csv file into vb? or just make a array or something?
3) in my .csv file, there are Date, Number 1, number 2, number 3
if i need to match the Number was inputed by Date, how can i do that
below is a example, plz give me a help to write the coding, thx.
best regards

my Input:

from date: 1/3/2001
to date: 5/5/2001
number input: 1, 5, 51

Data, from csv file

1/1/2001 5, 7, 11
5/1/2001 1, 3, 27
*15/4/2001 3, 25, 44
*25/4/2001 5, 31, 41
*5/5/2001 7, 21, 27
27/5/2001 8, 14, 19

ps. the *sign mean the number i need to compare in this case, which is given from my input, the data is tread by Date

in this case what will be the most easy way to complete the code. plz help me
thank you

How To Input .CSV Database File Into VB, By Only Input The Selected Area
hi, i am a very beginner of VB, and having so much trouble, i have few question plz give me a help, or give me some example...
the case i am doing is to into the database file .csv into VB
1) how do i input my .csv file As file__name
2) if i need to compare the number from my csv file, such as, matching my input to the database file .csv in some Specaific area, do i need to input whole .csv file into vb? or just make a array or something?
3) in my .csv file, there are Date, Number 1, number 2, number 3
if i need to match the Number was inputed by Date, how can i do that
below is a example, plz give me a help to write the coding, thx.
best regards

my Input:

from date: 1/3/2001
to date: 5/5/2001
number input: 1, 5, 51

Data, from csv file

1/1/2001 5, 7, 11
5/1/2001 1, 3, 27
*15/4/2001 3, 25, 44
*25/4/2001 5, 31, 41
*5/5/2001 7, 21, 27
27/5/2001 8, 14, 19

ps. the *sign mean the number i need to compare in this case, which is given from my input, the data is tread by Date

in this case what will be the most easy way to complete the code. plz help me
thank you

How To Format Textboxes (i.e For Numeric Input , Date Input)
hi,

i am new vb development & want to know how do i format textboxex i.e for numeric input , date input, right align , etc

please help

thanks

bye

pratik

HOW TO FILTER THE INPUT STRING In The Input Text Field
Hi,

I am trying to filter the string

STILL UNRESOLVED: NEED HELP - Simple Input Box With Multiple Input Lines
I am trying to use VBA to make an input box with multiple input lines. The inputs will all be integers, and they all need to be stored to their own specific variables OR AN ARRAY. So far I have only been able to figure out how to make an input box with one line, using the InputBox command. Can someone give me an idea, or an example of code, to do this? Thanks for any help. This is for work, so I will be very happy to get my code working right.



Edited by - Grant on 7/15/2003 12:12:45 PM

Input Title And Input Message To A Cell
Is it possible to set inputtitle and inputmessage to a cell like its done when adding a verification?

Code:
with Selection.Validation
.Add Type:=xlValidateTextLength, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="0", Formula2:="100"
.InputTitle = "Title"
.InputMessage = "Message"
end with
The standard comment is so lame.
The reason I cant use verification is that somehow the format of the cell gets lost then.

Input Of Numbers And Denies Alphabets Input
How to make a textbox; where its code enable user to type in numbers only and if whenever an alphabet is input, it will prompt the user a msgbox 'Please enter a value"?

I tried using keyAscii but it do not seem to be working...


Code:
Private Sub Eage_keyPress(KeyAscii As Integer)
If KeyAscii <> 8 And (KeyAscii < Asc("65") Or KeyAscii > Asc("90")) Then
KeyAscii = 0
Else: MsgBox "Please enter in a value"

End If
End Sub

Let User Input IP And Limit It To Numeric Input?
I wanna let the user input an IP address..
I had search on the forum and found sth like this..


Quote:




Originally Posted by dglienna
Just use a textbox with a regular text field. You can't have a number with more than one period (dot) in it. You can even use a mask to put in the dots.






What is a mask and how can put it in my program?
and, is it possible to set this textbox for numeric input only ??
and set the max value = 255 (since it's IP address..)

Hope someone could help ~
thx..

How To Make A Form Default All Field Values To The Previous Records Values ?
Using Access2000 on 2k.

Have a database form in single form view (has a sub form in it).
Got a request to put in a button that will do the same as new record but default the new record to all the same values as the current forms record shows. I think there are several ways to do this, I'm afraid I'll pick the most difficult one if left to my own devices. (i.e. DAO recordset looping etc.)

The first thing I tried was using a wizard to add a button and chose the duplicate record offer from the wizard. It almost works but it presents a record without the arrow or the pencil in it, gives it a record number that makes me think it has appended it. but when I move away from the record and back to it again, it's empty.

If I right click and copy and then paste it does what I expect it to. That is put the copied information in the end record.
But the user doesn't want to copy and paste, they just want to push the button and then modify the needed fields.

I wizard gave me code that looks like this:
Private Sub cmdDupRec_Click()
On Error GoTo Err_cmdDuplicate_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_cmdDuplicate_Click:
Exit Sub

Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click

End Sub

Copyright 2005-08 www.BigResource.com, All rights reserved