VISUAL FOXPRO VERSION 6.0
Hola, mi nombre es henry parazuela soy estudiante de informatica, estoy haciendo la pasantia y estoy realizando un proyecto, tengo una problema. No se como relacionar las 4 tablas que tengo para realizar un conculta general. Si me pueden ayudar se los agradesco muchos GRACIAS!!
hola te doy un ejemplo espero te sirva
en un combo box pon el siguiente codigo en click y init(obiamente con los campos de tu tabla)
-----------------------------------------init--------------------------------------------
select nunota, paciente from venta into cursor ccuadrotitulo
select ccuadrotitulo
go top
nNumRegs=Reccount()
if nNumRegs>0
thisform.cuadrotitulo.Clear()
thisform.cuadrotitulo.ColumnCount=2
for registro=1 to nNumRegs
thisform.cuadrotitulo.AddListItem(Alltrim(Str(ccuadrotitulo.nunota)),registro,1)
thisform.cuadrotitulo.AddListItem(Alltrim(ccuadrotitulo.paciente),registro,2)
skip
endfor
thisform.cuadrotitulo.ColumnWidths=('40,200')
else
=messagebox('Aun no hay socios registrados')
endif
----------------------------------click----------------------------------
Select distinct nunota ,paciente, precio, fecha;
from venta inner join producto on venta.nuproducto=producto.nuproducto;
inner join empleado on venta.nuempleado=empleado.nuempleado;
inner join doctor on venta.nudoctor=doctor.nudoctor;
where alltrim(upper(str(venta.nunota)))=alltrim(upper(thisform.cuadrotitulo.value));
order by fecha into cursor cRes
select cRes
if reccount()>0
thisform.grid1.columncount=fcount()
Thisform.Grid1.Column1.Header1.Caption='nunota'
Thisform.Grid1.Column1.Header1.Alignment=6
Thisform.Grid1.Column2.Header1.Caption='paciente'
Thisform.Grid1.Column2.Header1.Alignment=6
Thisform.Grid1.Column3.Header1.Caption='precio'
Thisform.Grid1.Column3.Header1.Alignment=6
thisform.grid1.visible=.T.
thisform.grid1.RecordSourceType=1
thisform.grid1.RecordSource='cRes'
thisform.grid1.refresh
Thisform.Grid1.Column1.Width=180
Thisform.Grid1.Column2.Width=120
Thisform.Grid1.Column3.Width=120
else
thisform.grid1.visible=.F.
=messagebox('No hay registros')
endif
en un combo box pon el siguiente codigo en click y init(obiamente con los campos de tu tabla)
-----------------------------------------init--------------------------------------------
select nunota, paciente from venta into cursor ccuadrotitulo
select ccuadrotitulo
go top
nNumRegs=Reccount()
if nNumRegs>0
thisform.cuadrotitulo.Clear()
thisform.cuadrotitulo.ColumnCount=2
for registro=1 to nNumRegs
thisform.cuadrotitulo.AddListItem(Alltrim(Str(ccuadrotitulo.nunota)),registro,1)
thisform.cuadrotitulo.AddListItem(Alltrim(ccuadrotitulo.paciente),registro,2)
skip
endfor
thisform.cuadrotitulo.ColumnWidths=('40,200')
else
=messagebox('Aun no hay socios registrados')
endif
----------------------------------click----------------------------------
Select distinct nunota ,paciente, precio, fecha;
from venta inner join producto on venta.nuproducto=producto.nuproducto;
inner join empleado on venta.nuempleado=empleado.nuempleado;
inner join doctor on venta.nudoctor=doctor.nudoctor;
where alltrim(upper(str(venta.nunota)))=alltrim(upper(thisform.cuadrotitulo.value));
order by fecha into cursor cRes
select cRes
if reccount()>0
thisform.grid1.columncount=fcount()
Thisform.Grid1.Column1.Header1.Caption='nunota'
Thisform.Grid1.Column1.Header1.Alignment=6
Thisform.Grid1.Column2.Header1.Caption='paciente'
Thisform.Grid1.Column2.Header1.Alignment=6
Thisform.Grid1.Column3.Header1.Caption='precio'
Thisform.Grid1.Column3.Header1.Alignment=6
thisform.grid1.visible=.T.
thisform.grid1.RecordSourceType=1
thisform.grid1.RecordSource='cRes'
thisform.grid1.refresh
Thisform.Grid1.Column1.Width=180
Thisform.Grid1.Column2.Width=120
Thisform.Grid1.Column3.Width=120
else
thisform.grid1.visible=.F.
=messagebox('No hay registros')
endif
