Question about Microsoft Office Project Standard 2007: Windows

1 Answer

I want alpha numeric in msaccess with primary key front end of vb

My save source code is given below

Private Sub cmd_save_Click()
'error cheaking and autocorrection handle
On Error GoTo errlable
If (cheak = True) Then
If (txt_note.Text = "") Then
txt_note.Text = "None"
End If
If (txt_phone.Text = "") Then
txt_phone.Text = "None"
End If
If (txt_mail.Text = "") Then
txt_mail.Text = "None"
End If

If (saveflag = True) Then
txt_bookhnd.Text = 0
str = "INSERT INTO Member "
str = str & "(Address, Birthdate, Bookinhand, Deposite, Doexpire, Dojoin, Email, Fname, Lname, Memid, Noted, Phone, ***) "
str = str & "VALUES('" & Trim(txt_add.Text) & "', "
str = str & "'" & Trim(msk_bdate.Text) & "', "
str = str & CDbl(txt_bookhnd.Text) & ", "
str = str & CDbl(Trim(txt_deposite.Text)) & ", "
str = str & "'" & Trim(msk_expr.Text) & "', "
str = str & "'" & Trim(msk_join.Text) & "', "
str = str & "'" & Trim(txt_mail.Text) & "', "
str = str & "'" & Trim(txt_fname.Text) & "', "
str = str & "'" & Trim(txt_lname.Text) & "', "
str = str & CDbl(Trim(txt_memid.Text)) & ", "
str = str & "'" & Trim(txt_note.Text) & "', "
str = str & "'" & Trim(txt_phone.Text) & "', "
str = str & "'" & Trim(cmb_sex.Text) & "' )"
'MsgBox str
Memconnection.Execute str
Else
str = "UPDATE Member SET "
str = str & " Address = '" & Trim(txt_add.Text) & "',"
str = str & " Birthdate = '" & Trim(msk_bdate.Text) & "',"
str = str & " Bookinhand = '" & Trim(txt_bookhnd.Text) & "',"
str = str & " Deposite = " & CDbl(txt_deposite.Text) & ","
str = str & " Doexpire = '" & Trim(msk_expr.Text) & "',"
str = str & " Dojoin = '" & Trim(msk_join.Text) & "',"
str = str & " Email = '" & Trim(txt_mail.Text) & "',"
str = str & " Fname = '" & Trim(txt_fname.Text) & "',"
str = str & " Lname = '" & Trim(txt_lname.Text) & "',"
str = str & " Memid = " & CDbl(txt_memid.Text) & ","
str = str & " Noted = '" & Trim(txt_note.Text) & "',"
str = str & " Phone = '" & Trim(txt_phone.Text) & "',"
str = str & " *** = '" & Trim(cmb_sex.Text) & "'"
str = str & " WHERE Memid= " & CDbl(txt_memid.Text)
'MsgBox str
Memconnection.Execute str
End If
Memrecordset.Requery
Memrecordset.MoveFirst
MsgBox ("Record saved successfully."), vbInformation, "Save"
Call locktext(True)
Call setbutton(True)
Call showdata
End If
Exit Sub
errlable:
If (Err.Number = -2147467259) Then
MsgBox ("Member ID already exist,please enter anothe ID."), vbCritical, "MemberID exist"
txt_memid.SetFocus
ElseIf (Err.Number = -2147217913) Then
MsgBox ("May be date field pattern wrong."), vbCritical, "Date"
ElseIf Err.Number <> 0 Then
MsgBox Err.Number & Err.Description
End If
End Sub


how to change numeric as alpha numeric in ms access with vb

Posted by on

  • ethenmozhi May 27, 2009

    Thank U sir, Thank u somach

×

Ad

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Governor:

    An expert whose answer got voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 78 Answers

CStr(variableName) where variableName contains the number

Posted on May 21, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

I have a problem about the code for vb 0.6 the code for progressbar


i put the timmer also to look nice add this code :
Private Sub Timer1_Timer()
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
Else
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(1)
End If
End Sub

If u Want A Button Disable The Timer add a Button with the Code Timer1.Enabled = True

Feb 19, 2010 | Computers & Internet

Tip

How to Open a Password Protected Word 2003 Document?


Microsoft Word document offer password protection which allows you to protect your sensitive information containing in your Word file, then anyone who wish to access to your file should enter the correct alpha-numeric password firstly. If you cannot open a secured word 2003 document, it must be irritating, right? This article will show you three effective options to <a href="http://recoverlostpassword.com/products/wordpasswordrecovery.html"><u>open a password protected word 2003 document</u></a>.<br /> <br /> <img src="open-password-protected-word-document.jpg" /><br /> <b><br /> <br /> Method 1: Using VB.NET<br /> </b><br /> <br /> The following code sample shows how to open a password protected word document using VB.NET<br /> <br /> [VB.NET CODE STARTS]<br /> Dim objWord As Object<br /> Dim strPassword as string = "PASSWORD"<br /> <br /> objWord = CreateObject("Word.Application")<br /> objWord.visible = False<br /> objWord.application.WindowState = 2<br /> objWord.application.DisplayAlerts = False<br /> <br /> Try<br /> objWord.Documents.Open("YOUR DOCUMENT FULL PATH NAME", PasswordDocument:=strPassword )<br /> Catch ex As Exception<br /> Msgbox ("Cannot open word document" ,vbExclamation , "Password Protected")<br /> End Try<br /> [VB.NET CODE ENDS]<br /> <br /> <br /> <b>Method 2: Obtain the password from the source</b><br /> <br /> <br /> The following steps sample shows how to obtain the password from the source<br /> Step 1: Check with the word document source for the password.<br /> Ask yourself where does the locked word 2003 document come from? Supposing it created by someone else, then ask the creator for the password. If your own are the word document source, you will need to locate the lost password.<br /> Step 2: Verify the password with the source.<br /> Make sure you have the right password on hand. Verify the password can save you time. The other reason to do so is that you never know they might have given you the wrong password in the first place.<br /> Step 3: Enter the correct password.<br /> Type in the correct password at the "Enter Password To Open File" dialog box. After you have entered the password, click the OK button.<br /> <br /> <b><br /> Method 3: Using password-cracking software</b><br /> <br /> <br /> If so far you still didn't solve your problem, then you'll have to go buy one of password-cracking software available for this purpose. So go to the link in "Source(s)" and download the <a href="http://www.recoverlostpassword.com/products/wordpasswordrecovery.html">word password cracker</a> program. It comes with a trial version and follows the walk through. You only need to use the program to open the locked word document, choose the type of attacks for word document with strong encryption. Then the program will start and keep running until find out the lost word password for you to open.<br /> Source(s):Good Search: <a href="http://recoverlostpassword.com/products/wordpasswordrecovery.html">SmartKey Word Password Recovery<br /> </a><br /> <br /> Keep in mind that there nothing will miss as long as you use the corresponding password to<a href="http://recoverlostpassword.com/products/wordpasswordrecovery.html"> <u>open your password protected word document</u></a>. <br /> <br /> Article Source:<a href="http://recoverlostpassword.com/article/open-password-protected-word-2003-document.html">http://www.recoverlostpassword.com/article/open-password-protected-word-2003-document.html</a> <br />

on Apr 15, 2011 | Computers & Internet

1 Answer

Program code that can light a bulb using vb


You can do it a couple of ways, but this would probably be the shortest. Realize this depends on what forms you're qualifying for the pictures.

  1. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2. '
  3. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
  4. End Sub
  5. Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
  6. '
  7. PictureBox1.Image = Image.FromFile("C:\BulbOn.jpg")
  8. End Sub
  9. Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
  10. '
  11. PictureBox1.Image = Image.FromFile("C:\BulbOff.jpg")
  12. End Sub

Jan 05, 2010 | Microsoft Step by Step Visual Basic 6.0...

1 Answer

Vb projects


One of the assignments given for a masters
was to provide an input box for english postcodes (zip fer other places) that would filter out ANY invalid input in as few lines as possible.

With entirely numeric that is simple as it is just a string length
but some countries use alpha numeric and the letters have to be in the correct places eg. wf15 9lf or WF15 9LF or W15 would all be valid but W15 9LF would not..

Again minimal code would show an attention to detail because anyone can write a 100 lines of code to do that try get it in 15 or much less and it becomes more impressive


Specific alpha numeric data input and format sorting always seems to go down well with professors.

I havent given you everything to write the abstract bu the bare bones are there and it gives you an idea of the types of thing looked for.

After all if I gave you the whole thing it would not have been your work.

Aug 25, 2009 | Microsoft Computers & Internet

1 Answer

Create a barcode for F1 and F2 using Labelview


If you have created your barcodes as "F1" and "F2" you will have to create two Advanced Data Formatting rules with the LS2208 Product Reference Guide. This link will take you to the manual. Print only the barcodes you need from the list below then scan them in the order they are listed:
Begin New Rule
Specific String at Start
F (from the Alpha-numeric section of manual)
1 (from the Alpha-numeric section of manual)
End of message (from the Alpha-numeric section of manual)
Send F1 Key
Save Rule
Begin New Rule
Specific String at Start
F
2
End of Message
Send F2
Save Rule

That should do it!

May 06, 2009 | Symbol LS2208 Handheld

1 Answer

Out of memory error


1. Use with - End With for values

with xlWbk.Worksheets(1)
.Range(.cells(1), .cells(4)).value = "Some Repeated Text"
end with

2. Use following VB code for killing excle at the end:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As
Long

Private Const WM_QUIT = &H12

Sub TerminateExcel()

Dim lpClassName As String
Dim iHwnd As Long
Dim iReturn As Long

lpClassName = "XLMain"
iHwnd = FindWindow(lpClassName, 0&)

If iHwnd Then
iReturn = PostMessage(iHwnd, WM_QUIT, 0&, 0&)
End If

End Sub

Mar 17, 2009 | Business Objects Crystal Reports® XI...

1 Answer

How to connect vb with ms access


se Adodc OR Even better.. ADODB. for this you need to get MDAC fromMicrosoft free download.(check under project_References- Microsoft DataActiveX objects.. the current no is 2.8. if it is not there download invb directory.

next, you can learn about creating a DSN from control panel, ODBC. onceyou learn this, connection becomes a piece of cake. get some free vbtutoriasl from WWW.

then

you need to use DAO or ADO to connect to the database. better study both but since ADO is current, i am showing that code.
under Menu Project_References, put a check mark on Microsoft ActiveXData Objects latest version (though it works for all, currently 2.8with sp pack 1 ).

at the general declarations:
dim conn as adodb.connection, rec as adodb.recordset, esql as string,esql1 as string
Private Function connect()
Set rec = New ADODB.Recordset
Set conn = New ADODB.Connection
esql = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:VBDesigndhana2.mdb" & ";Persist Security Info=False"
'here you put the correct path of your mdb file. and check if you have jet 4.0

conn.Open (esql), , , 0
End Function

private sub form_Load()
connect
end sub
and for adding records:
say let us say you have 3 fields. then have 3 textboxes and 1 command button on the form.

private command1_click()
esql1="select * from Yourtablename"
rec.open(esql1),conn,, adOpenDynamic, adLockOptimistic
rec.AddNew
rec.Fields(0) = text1.Text
rec.Fields(1) = Text2.text
rec.Fields(2) = text3.text
' you need to check if in your access table design you have Allowed Zero length .. set it to Yes for all text fields.
rec.update
if not rec.eof then rec.movenext
rec.close
conn.close
set conn to nothing
end sub

this will add new records to access table from VB.
' for picture store the full path of the path and the picture file nameint the text field. and in the picturebox of VB form for viewingrecords again you need ADO or ADODC and here you code:picture1.picture=Loadpicture(rec.fields(3) ' depending on where thepicture field is located. you need to make a few trials.
under Menu Project_References, put a check mark on Microsoft ActiveXData Objects latest version (though it works for all, currently 2.8with sp pack 1 ).

at the general declarations:
dim conn as adodb.connection, rec as adodb.recordset, esql as string,esql1 as string

Private Function connect()
Set rec = New ADODB.Recordset
Set conn = New ADODB.Connection
esql = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:VBDesigndhana2.mdb" & ";Persist Security Info=False"
'here you put the correct path of your mdb file. and check if you have jet 4.0

conn.Open (esql), , , 0
End Function

private sub form_Load()
connect
end sub

and for accessing records:

private command1_click()
esql1="select * from Yourtablename where id =" & val(text1) ' for integers

esql1="select * from Yourtablename where name=" & "'" & text1 & "'" ' for string

rec.open(esql1),conn, adOpenstatic, adLockreadonly

label1.caption =rec.Fields(0)
label2.caption= rec.Fields(1)
label3.caption= rec.Fields(2)
' you need to check if in your access table design you have Allowed Zero length .. set it to Yes for all text fields.

rec.close
conn.close
set conn to nothing
end sub


' similarly there are routines to ADD, Delete, Edit, View etc.

Feb 26, 2009 | Computers & Internet

1 Answer

Write into excel format


Your code does not save in access format it just makes a copy of existing file. You need to open table by table and export data using csv format.
It can be done using access OLE to export, or
write some VB code to access the database tables via ODBC and save row data to csv file

Feb 17, 2009 | Microsoft Visual Basic Professional...

2 Answers

Vb code for automatic number change


You want the code for when you press enter in textbox it automatically change to 1.

I am typing C# code you can easly covert it to VB.Net code

make an event for key press for textbox
and write the followting code in the event
IF textbox1.text = ""
textbox1.text = "1"
End IF

I hope your problem will solve with this If need more assistance let me know. If your problem is solved then don't forget to make answer my thread.

Regards

Nov 17, 2008 | Computers & Internet

1 Answer

Access-VB


Use this line below:

Private Sub CommandButton_Click()

Dim NumericValue as Integer
Dim StringValue as String

NumericValue = CInt(TextField1)
StringValue = TextField2

DoCmd.RunSQL "INSERT INTO NameOfTable ( [FieldName1], [FieldName2]) VALUES (" & NumericValue & " , '" & StringValue & "');"

EndSub

I Hope this work for you... God Bless

Jul 16, 2008 | Microsoft Office Access 2003 (077-02871)...

Not finding what you are looking for?
Microsoft Office Project Standard 2007: Windows Logo

728 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2845 Answers

Piyal Perera
Piyal Perera

Level 3 Expert

528 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18402 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...