Database Help

Database Help

Post by Graeme Ros » Sat, 01 Jul 2000 04:00:00



All I want to do is Use Option Buttons to Select A value and Update a access
database

Database (Access 97)
    Table1
        Field1 (number 1or2)

Visual Basic (6)
    Form1
        Frame1
            Option1 = If checked I want the record in Database.Table1.Field1
to 1
            Option2 = If checked I want the record in Database.Table1.Field1
to 2

How do I go about this
Any Help Would Be Much Appreciated

Thanks
Graeme

 
 
 

Database Help

Post by Alla » Sat, 01 Jul 2000 04:00:00


Usually a field holds the value(Key to use to define the record

Private Sub CmdUpdate_Click()

SELECT CASE Option1.Value
Case1
DB.execute "UPDATE Table1 SET Fld 1 = 1 WHERE PK_Field = '" &
strVaraiable & "'"
Case Else
DB.execute "UPDATE Table1 SET Fld 1 = 2 WHERE PK_Field = '" &
strVaraiable & "'"
End Select

End Sub

HTH



Quote:>All I want to do is Use Option Buttons to Select A value and Update a access
>database

>Database (Access 97)
>    Table1
>        Field1 (number 1or2)

>Visual Basic (6)
>    Form1
>        Frame1
>            Option1 = If checked I want the record in Database.Table1.Field1
>to 1
>            Option2 = If checked I want the record in Database.Table1.Field1
>to 2

>How do I go about this
>Any Help Would Be Much Appreciated

>Thanks
>Graeme


 
 
 

Database Help

Post by Jim in Clevelan » Sat, 01 Jul 2000 04:00:00



> All I want to do is Use Option Buttons to Select A value and Update a access
> database

> Database (Access 97)
>     Table1
>         Field1 (number 1or2)

> Visual Basic (6)
>     Form1
>         Frame1
>             Option1 = If checked I want the record in Database.Table1.Field1
> to 1
>             Option2 = If checked I want the record in Database.Table1.Field1
> to 2

> How do I go about this

  Depends on whether you have an open recordset of the records from your
table.  Depends on whtether you wanna do this by ADO or DAO.  Depends
whether you're updating just one record or many.  Let's say you've used
DAO to OpenDatabase as dbGraeme, and your data is displayed one record
at a time on a form with these OptionButtons of yours - assume the
display also includes a key field such as a Label showing EmployeeID
number (lblEmpID).  You could say:

Dim strSQL as String

strSQL = "UPDATE Table1 SET Field1 = " _
       & IIf(Option1.Value = True, 1, 2) _
       & " WHERE EmployeeID = " & lblEmpID.Caption

dbGraeme.Execute strSQL
If dbGraeme.RecordsAffected = 1 Then
   MsgBox "Record updated successfully"
Else: MsgBox "Update failed"
End If

  Of course if you'd enjoy the task, you could write your own data-bound
pair of OptionButtons of a frame;  I did that for a project once to meet
client's request...but that's a bit more coding!
  If you want more details specific to your application, please post
more info.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"
 ((("What's so funny 'bout peace, love & understanding?" - Nick Lowe)))

 
 
 

1. Sound effects database help

Right, now I think I might be in the right place, but if I am not, please do
not be offended by the following questions.
I am a sound designer for films and have spent the past few years creating a
library of my own sound fx. What I want to do, is convert them into an audio
file format, which can be accessed via a web interface browsable database.
I have already created an excel spreadsheet of these sound fx. I have
digitsed and converted them all to .wav formt. All of these files are
sitting on one drive on my server-equipped pc. The excel spreadsheet even
contains all of the necessary hyperlinks for each file. So for instance when
I do a search for door in excel, I can click on the relevant hyperlink for
each result, and the related sound effect will eiuther be downloaded or
played.

I find the excel interfce rather cumbersome, and would prefer something
which can be accessed through IE or netscape. So I realise I have to go out
of my depth, in terms of creating an access database maybe, with relevant
queries, maybe using php, or SQL of some sorts. I am aware that these are
the areas which will help in achieving the end result, but fter that I am
stumped as to where to begin.

Excel spreadsheet to ..some form of queried database
Host database via server
Query database through web interface
Show only results pertaining to search criteria
Allow resultant sound fx to be played or downloaded

Please if anyone can begin to help, i will be very very grateful.

M. T. Loop

2. 13723-WA-Seattle-ORACLE-ORACLE-PL/SQL-Technical background-Programmer

3. Searching a database, HELP!!

4. 2Mx32 60ns $34.00

5. Beginner DataBase , HELP ME

6. Determining the median, mode and mean

7. Shrink Database - Help

8. oraInventary

9. Need backup database help.

10. Online database help

11. Error Restoring the database HELP!!!!!!!!!!

12. deleted default database - help !!! [MULTIPOST]

13. corrupted database - HELP